本文整理了Java中javax.swing.JTree.setPreferredSize()
方法的一些代码示例,展示了JTree.setPreferredSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.setPreferredSize()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:setPreferredSize
暂无
代码示例来源:origin: pl.touk/test-generator
private void createTree()
{
DefaultMutableTreeNode top = new DefaultMutableTreeNode("TestGenerator");
createNodes(top);
tree = new JTree(top);
tree.setCellRenderer(new AssertionTreeCellRenderer());
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(new TreeChangeListener());
// tree.setSize(new Dimension(300, 400));
int height = (result.getTestCases().size())*(result.getTestCases().get(0).getTestSteps().size()*30);
tree.setPreferredSize(new Dimension(200, height));
tree.setMinimumSize(new Dimension(150, 500));
tree.setMaximumSize(new Dimension(800, Integer.MAX_VALUE));
treeView = new JScrollPane(tree);
treeView.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
treeView.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
}
代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common
protected void buildTree() throws Exception {
if (trIndex_ == null) {
trIndex_ = new BuTree(new DefaultTreeModel(new DefaultMutableTreeNode("Chargement ...")));
trIndex_.setPreferredSize(new Dimension(150, 450));
trIndex_.setRootVisible(false);
trIndex_.setShowsRootHandles(true);
trIndex_.setFont(BuLib.deriveFont("Tree", Font.PLAIN, -2));
trIndex_.addTreeSelectionListener(this);
}
new Thread() {
public void run() {
final TreeModel model = createIndex();
BuLib.invokeLater(new Runnable() {
public void run() {
if (model == null) {
trIndex_.setVisible(false);
} else {
trIndex_.setVisible(true);
trIndex_.setModel(model);
}
}
});
}
}.start();
}
代码示例来源:origin: org.apache.uima/uimaj-tools
this.fsTree.setPreferredSize(fsTreeDimensionDefault);
} else {
setPreferredSize(this.textScrollPane, textSizePref);
代码示例来源:origin: SAMLRaider/SAMLRaider
certificateTree = new JTree(certificateTreeModel);
certificateTree.setVisibleRowCount(15);
certificateTree.setPreferredSize(new Dimension(30, 30));
certificateTree.setAlignmentY(Component.TOP_ALIGNMENT);
certificateTree.setAlignmentX(Component.LEFT_ALIGNMENT);
内容来源于网络,如有侵权,请联系作者删除!