javax.swing.JScrollPane.getPreferredSize()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中javax.swing.JScrollPane.getPreferredSize()方法的一些代码示例,展示了JScrollPane.getPreferredSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JScrollPane.getPreferredSize()方法的具体详情如下:
包路径:javax.swing.JScrollPane
类名称:JScrollPane
方法名:getPreferredSize

JScrollPane.getPreferredSize介绍

暂无

代码示例

代码示例来源:origin: wiztools/rest-client

private void loadFromFile(File f) {
  if(f != null){
    try{
      String content = FileUtil.getContentAsString(f, Charsets.UTF_8);
      Dimension d = jsp_in.getPreferredSize();
      jta_in.setText(content);
      jta_in.setCaretPosition(0);
      jsp_in.setPreferredSize(d);
    }
    catch(IOException ex){
      ui.getView().showError(Util.getStackTrace(ex));
    }
  }
}

代码示例来源:origin: wiztools/rest-client

tm_errors.setData(result.getErrors());
Dimension d = jsp_jta_trace.getPreferredSize();
jta_trace.setText(result.toString());
jta_trace.setCaretPosition(0);

代码示例来源:origin: wiztools/rest-client

jt_res_headers.setModel(resHeaderTableModel);
JScrollPane jsp = new JScrollPane(jt_res_headers);
Dimension d = jsp.getPreferredSize();
d.height = d.height / 2;
jsp.setPreferredSize(d);

代码示例来源:origin: pentaho/mondrian

if (relationRenderer != null) {
  relationRenderer.setPreferredSize(
    jScrollPaneT.getPreferredSize());
  relationRenderer.setMaximumSize(
    jScrollPaneT.getPreferredSize());

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** Gets preferred size of left scroll pane.
 */
int getControllingViewWidth() {
  return controllingView.getPreferredSize().width;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Gets preferred size of left scroll pane.
     */
    int getControllingViewWidth() {
      return controllingView.getPreferredSize().width;
    }
/*

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-profiler

public Dimension getPreferredSize() {
    Dimension d = super.getPreferredSize();
    d.width = Math.max(d.width, 400);
    return d;
  }
}, BorderLayout.CENTER);

代码示例来源:origin: com.synaptix/SynaptixSwing

public Dimension preferredLayoutSize(Container parent) {
  if (scrollPane != null) {
    return scrollPane.getPreferredSize();
  }
  return new Dimension();
}

代码示例来源:origin: freeplane/freeplane

@Override
public Dimension getPreferredSize() {
  validate();
  return super.getPreferredSize();
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

@Override
  public Dimension getPreferredSize() {
    Dimension result = super.getPreferredSize();
    result = new Dimension(Math.min(result.width, SelectableListView.this.getWidth() - 20), result.height);
    return result;
  }
};

代码示例来源:origin: pentaho/pentaho-reporting

/**
 * Adjusts the size of the dialog to fit the with of the contained message and stacktrace.
 */
public void adjustSize() {
 final Dimension scSize = scroller.getPreferredSize();
 final Dimension cbase = filler.getPreferredSize();
 cbase.width = Math.max( scSize.width, cbase.width );
 cbase.height = 0;
 filler.setMinimumSize( cbase );
 pack();
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-core

@Override
public void setWidth(Number width) {
  super.setWidth(width);
  int w = width.intValue();
  if (w == PREFERRED || w == FILL) {
    return;
  }
  int height = fieldScroll.getPreferredSize().height;
  fieldScroll.setPreferredSize(new Dimension(w, height));
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-core

@Override
public void setHeight(Number height) {
  super.setHeight(height);
  int h = height.intValue();
  if (h == PREFERRED || h == FILL) {
    return;
  }
  int width = fieldScroll.getPreferredSize().width;
  fieldScroll.setPreferredSize(new Dimension(width, h));
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

@Override
  public Dimension getPreferredSize() {
    Dimension result = super.getPreferredSize();
    result = new Dimension(Math.min(result.width, TabularFilterView.this.getWidth() - 20), result.height);
    return result;
  }
};

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

public void run()
  {
    double mainWidth = main.getSize().getWidth();
    double optionsWidth = options.getPreferredSize().getWidth();
    // consider scrollbar width if visible
    double scrollWidth = options.getVerticalScrollBar().isVisible() ? options.getVerticalScrollBar().getWidth() : 0;
    double	loc	= (mainWidth - optionsWidth - scrollWidth) / mainWidth;
    if(loc>=0 && loc<=1)	// Might be NaN, if plugin is switched before panel is shown.
      main.setDividerLocation(loc);
  }
});

代码示例来源:origin: cmu-phil/tetrad

private JSplitPane createSplitPane(UpdaterWrapper updaterWrapper) {
  JScrollPane workbenchScroll = createWorkbenchScroll(updaterWrapper);
  workbenchScroll.setBorder(new TitledBorder("Manipulated Graph"));
  JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
      workbenchScroll, createRightPanel(updaterWrapper));
  splitPane.setOneTouchExpandable(true);
  splitPane.setDividerLocation(workbenchScroll.getPreferredSize().width);
  return splitPane;
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

public void run()
  {
    double mainWidth = main.getWidth();
    double optionsWidth = options.getPreferredSize().getWidth();
    // consider scrollbar width if visible
    double scrollWidth = options.getVerticalScrollBar().isVisible() ? options.getVerticalScrollBar().getWidth() : 0;
    double	loc	= (mainWidth - optionsWidth - scrollWidth) / mainWidth;
    if(loc>=0 && loc<=1)	// Might be NaN, if plugin is switched before panel is shown.
      main.setDividerLocation(loc);
  }
});

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

public void run()
  {
    double mainWidth = main.getWidth();
    double optionsWidth = options.getPreferredSize().getWidth();
    // consider scrollbar width if visible
    double scrollWidth = options.getVerticalScrollBar().isVisible() ? options.getVerticalScrollBar().getWidth() : 0;
    double	loc	= (mainWidth - optionsWidth - scrollWidth) / mainWidth;
    if(loc>=0 && loc<=1)	// Might be NaN, if plugin is switched before panel is shown.
      main.setDividerLocation(loc);
  }
});

代码示例来源:origin: freeplane/freeplane

@Override
  public Dimension getPreferredSize() {
    if (!isValid()) {
      doLayout();
    }
    return super.getPreferredSize();
  }
}

代码示例来源:origin: apache/felix

public ShellPanel(Activator activator)
{
  m_activator = activator;
  m_activator.addPropertyChangeListener(this);
  setLayout(new BorderLayout());
  JScrollPane scroll = null;
  add(scroll = new JScrollPane(m_pluginList = new JList(new SimpleListModel())), BorderLayout.WEST);
  scroll.setPreferredSize(new Dimension(150, scroll.getPreferredSize().height));
  add(m_emptyPanel = new JPanel(), BorderLayout.CENTER);
  createEventListeners();
}

相关文章

JScrollPane类方法