我正在使用 Swing n Netbeans IDE 卡在一个点上。我想在 JTable 的单元格之一中添加文本文件的地址。此外,如果我单击该字段它应该打开相同的文件。
jInternalFrame3.setVisible(true);
jTable3.setBackground(new java.awt.Color(0, 0, 0));
jTable3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jTable3.setForeground(new java.awt.Color(255, 255, 255));
jTable3.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Sr. No", "EXCHANGE", "INSTRUMENT", "SYMBOL", "EXPIRY DATE", "B/S", "LOT/QTY", "PRICE", "STOP LOSS", "TRIGGER PRICE", "FILE NAME", "TIME CREATED"
}
) {
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false, false, false, false, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];