qui istanzio il vettore:
Codice PHP:
JTable[] tabelle={this.tabella1, this.tabella2, this.tabella3, this.tabella4, this.tabella5, this.tabella6, this.tabella7, this.tabella8, this.tabella9};
mentre ogni singola tabella viene creata in automatico dal compilatore, cioè crea questo:
Codice PHP:
tabella1 = new javax.swing.JTable();
----
tabella3.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Somma Faccie", "Frequenza", "Probabilità"
}
) {
Class[] types = new Class [] {
java.lang.Integer.class, java.lang.Double.class, java.lang.Double.class
};
boolean[] canEdit = new boolean [] {
false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane3.setViewportView(tabella3);
tabella3.getColumnModel().getColumn(0).setResizable(false);
tabella3.getColumnModel().getColumn(1).setResizable(false);
tabella3.getColumnModel().getColumn(2).setResizable(false);