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

📄 e926. getting and setting a cell value in a jtable component.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
// Retrieve the value in the visible cell (1,2)
    int rowIndex = 1;
    int vColIndex = 2;
    Object o = table.getValueAt(rowIndex, vColIndex);
    
    // Retrieve the value in cell (1,2) from the model
    rowIndex = 1;
    int mColIndex = 2;
    o = table.getModel().getValueAt(rowIndex, mColIndex);
    
    // Change a cell in the 2nd visible column
    rowIndex = 2;
    vColIndex = 1;
    table.setValueAt("New Value", rowIndex, vColIndex);
    
    // Change a cell in the 3rd column in the model
    rowIndex = 3;
    mColIndex = 2;
    table.getModel().setValueAt("New Value", rowIndex, mColIndex);

⌨️ 快捷键说明

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