Closedown

This commit is contained in:
boccioli_m
2015-06-08 14:23:20 +02:00
parent 0cd6e31656
commit e06ebc79c1
2 changed files with 59 additions and 11 deletions

View File

@@ -46,11 +46,55 @@
<SubComponents>
<Component class="javax.swing.JTable" name="jTable1">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new javax.swing.table.DefaultTableModel(&#xa; new Object [][] {&#xa; {null, null, null, null, null, null, null},&#xa; {null, null, null, null, null, null, null},&#xa; {null, null, null, null, null, null, null},&#xa; {null, null, null, null, null, null, null}&#xa; },&#xa; new String [] {&#xa; &quot;Select&quot;, &quot;Title 1&quot;, &quot;Title 3&quot;, &quot;Title 4&quot;, &quot;Title 5&quot;, &quot;&quot;, &quot;Icon&quot;&#xa; }&#xa;) {&#xa; Class[] types = new Class [] {&#xa; java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class&#xa; };&#xa; boolean[] canEdit = new boolean [] {&#xa; true, true, true, true, true, true, false&#xa; };&#xa;&#xa; public Class getColumnClass(int columnIndex) {&#xa; switch (columnIndex){&#xa; case 0:&#xa; return Boolean.class;&#xa; case 6:&#xa; return ImageIcon.class;&#xa; }&#xa; return types [columnIndex];&#xa; }&#xa;&#xa; public boolean isCellEditable(int rowIndex, int columnIndex) {&#xa; return canEdit [columnIndex];&#xa; }&#xa;}" type="code"/>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="7" rowCount="4">
<Column editable="true" title="Select" type="java.lang.Boolean"/>
<Column editable="true" title="Title 1" type="java.lang.Object"/>
<Column editable="true" title="Title 3" type="java.lang.Object"/>
<Column editable="true" title="Title 4" type="java.lang.Object"/>
<Column editable="true" title="Title 5" type="java.lang.Object"/>
<Column editable="true" title="" type="java.lang.Object"/>
<Column editable="false" title="Icon" type="java.lang.Object"/>
</Table>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0"/>
<TableColumnModel selectionModel="0">
<Column maxWidth="-1" minWidth="-1" prefWidth="5" resizable="false">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="10" resizable="false">
<Title/>
<Editor/>
<Renderer/>
</Column>
</TableColumnModel>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>

View File

@@ -167,12 +167,6 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
};
public Class getColumnClass(int columnIndex) {
switch (columnIndex){
case 0:
return Boolean.class;
case 6:
return ImageIcon.class;
}
return types [columnIndex];
}
@@ -181,6 +175,12 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
}
});
jScrollPane2.setViewportView(jTable1);
if (jTable1.getColumnModel().getColumnCount() > 0) {
jTable1.getColumnModel().getColumn(0).setResizable(false);
jTable1.getColumnModel().getColumn(0).setPreferredWidth(5);
jTable1.getColumnModel().getColumn(6).setResizable(false);
jTable1.getColumnModel().getColumn(6).setPreferredWidth(10);
}
add(jScrollPane2, java.awt.BorderLayout.PAGE_END);
}// </editor-fold>//GEN-END:initComponents
@@ -223,8 +223,12 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
{false, sDate, "FIXL", "Lamp Test", "Failure", "Pending", icon}
};
DefaultTableModel model = new DefaultTableModel(data, columnNames);
jTable1.setModel(model);
//DefaultTableModel model = new DefaultTableModel(data, columnNames);
//jTable1.setModel(model);
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
model.addRow(data);
}
public String getNow(){