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

📄 e949. packing a jtable component.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
This example demonstrates how to adjust the preferred size of a JTable to be just large enough to accommodate the preferred size of all cells. 
    int rows = 10;
    int cols = 5;
    JTable table = new JTable(rows, cols) {
        // Override this method so that it returns the preferred
        // size of the JTable instead of the default fixed size
        public Dimension getPreferredScrollableViewportSize() {
            return getPreferredSize();
        }
    };
    
    // Allow columns to be resized
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    
    // Add data...
    
    // These packing methods are defined in e950 Packing a Column of a JTable Component
    // and e913 Setting the Height of a Row in a JTable Component
    packColumns(table, 2);
    packRows(table, 0);

⌨️ 快捷键说明

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