本文整理了Java中javax.swing.JTree.getPreferredScrollableViewportSize()
方法的一些代码示例,展示了JTree.getPreferredScrollableViewportSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.getPreferredScrollableViewportSize()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:getPreferredScrollableViewportSize
暂无
代码示例来源:origin: org.gosu-lang.gosu/gosu-editor
@Override
public Dimension getPreferredScrollableViewportSize()
{
Dimension dim = super.getPreferredScrollableViewportSize();
dim.width = _iWidth; // Make the tree a bit roomier.
return dim;
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
@Override
public Dimension getPreferredScrollableViewportSize()
{
Dimension dim = super.getPreferredScrollableViewportSize();
dim.width *= (bShowBeanRoots ? 3 : 1); // Make the tree a bit roomier.
dim.width = Math.min( dim.width, 480 );
dim.height *= (bShowBeanRoots ? 2 : 1); // Make the tree a bit roomier.
return dim;
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-editor
@Override
public Dimension getPreferredScrollableViewportSize()
{
Dimension dim = super.getPreferredScrollableViewportSize();
dim.width *= (bShowBeanRoots ? 3 : 1); // Make the tree a bit roomier.
dim.width = Math.min( dim.width, 480 );
dim.height *= (bShowBeanRoots ? 2 : 1); // Make the tree a bit roomier.
return dim;
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
public Dimension getPreferredScrollableViewportSize()
{
Dimension r;
try { r=super.getPreferredScrollableViewportSize(); }
catch(Exception ex) { r=new Dimension(120,80); }
return r;
}
代码示例来源:origin: org.zaproxy/zap
@Override
public Dimension getPreferredScrollableViewportSize() {
Dimension dNT = contextsTree.getPreferredScrollableViewportSize();
Dimension dCT = sitesTree.getPreferredScrollableViewportSize();
dCT.setSize(Math.max(dNT.getWidth(), dCT.getWidth()), dNT.getHeight() + dCT.getHeight());
return dCT;
}
代码示例来源:origin: com.fifesoft.rtext/fife.common
/**
* This method is overridden to ensure that all nodes in the tree are
* expanded (as if they're not, the size of the window and its widgets
* may be incorrect; not enough room for the tree).
*
* @param visible Whether or not this dialog should be visible.
*/
@Override
public void setVisible(boolean visible) {
if (visible) {
UIUtil.expandAllNodes(optionTree);
// Set the preferred size of the scroll pane so that it stays the
// same size no matter what nodes they click on/hide. If we
// don't do this, the JScrollPane resizes when you click on nodes
// to show the entire displayed node - annoying!
Dimension size = optionTree.getPreferredScrollableViewportSize();
size.width += 45; // Just in case a scrollbar is there.
optionTreeScrollPane.setPreferredSize(size);
pack();
}
// Initially select the first node.
int[] selectedRows = optionTree.getSelectionRows();
if (selectedRows==null || selectedRows.length==0) {
optionTree.setSelectionRow(0);
}
super.setVisible(visible);
}
内容来源于网络,如有侵权,请联系作者删除!