⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e1031. setting the row height of a jtree component.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
The tree component's row height property controls the height of every displayed node. If the row height is greater than 0, all rows will be given the specified height. However, if the rows can be of differing heights, it is necessary to set the row height to 0. With a 0 row height, all heights of all rows are computed individually. 
    // Create tree
    JTree tree = new JTree();
    
    // All rows will be given 15 pixels of height
    tree.setRowHeight(15);
    
    // Have the row height for each row computed individually
    tree.setRowHeight(0);
    
    // If the row height is 0 and the height of a row has dynamically changed, it is necessary
    // to flush the internal cache of row heights. The following calls flush the internal cache.
    if (tree.getRowHeight() <= 0) {
        // Temporary change to non-zero height
        tree.setRowHeight(1);
    }
    tree.setRowHeight(0);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -