javax.swing.JTree.setPreferredSize()方法的使用及代码示例

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

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

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);

相关文章

JTree类方法