我的表格模型如下。我的表的第一個顏色是複選框。我能夠把複選框放在jtable中,但是當我在該複選框上執行操作時,它什麼都不做。我用DefaultTableCellRenderer把複選框放在我的表格中。 public class MyTableModel implements TableModel {
ArrayList<PersonDTO> list=new ArrayList<Pe
我得到一個類對象(名爲:store)的數組。我不得不從商店數組中檢索一些值,並想用這些值填充我的JTable(Object [] []數據)。我已經將這個數組傳入了一個類,我正計劃繪製包含該表的用戶界面。所以,我的代碼看起來像 public class Dialog { // Here is where i plan to draw my UI (including the table)
...
我嘗試在添加圖像時使用setValueAt,但問題是它打印字符串並且不加載圖像。對此有任何幫助。代碼如下 int selectedColumn = table1.getSelectedColumn();
int selectedRow = table1.getSelectedRow();
ImageIcon addIcon = new ImageIcon("c:\\onion.png");