Closedown
This commit is contained in:
@@ -44,18 +44,24 @@
|
||||
<Component class="javax.swing.JTable" name="jTable1">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||
<Table columnCount="6" rowCount="4">
|
||||
<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">
|
||||
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false">
|
||||
<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/>
|
||||
|
||||
@@ -111,14 +111,22 @@ public class TestingList extends Panel {
|
||||
}
|
||||
}
|
||||
}
|
||||
ImageIcon icon = new ImageIcon("icons/button_reload.png");
|
||||
jTable1.setValueAt(icon, rowD, COL_ICON);
|
||||
|
||||
if(colT>0 && rowD>0){
|
||||
|
||||
jTable1.setValueAt(res, rowD, COL_RESULT);
|
||||
jTable1.setValueAt(success, rowD, COL_SUCCESS);
|
||||
jTable1.getCellEditor(rowD, COL_SUCCESS);
|
||||
ImageIcon icon = new ImageIcon("icons/button_reload.png");
|
||||
jTable1.setValueAt(icon, rowD, COL_ICON);
|
||||
|
||||
|
||||
}
|
||||
else{ //no test found in table. appen new one
|
||||
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
|
||||
model.addRow(new Object[]{true, getNow(), deviceName, testName,res, success,icon });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
@@ -140,20 +148,20 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
|
||||
|
||||
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||||
new Object [][] {
|
||||
{null, null, null, null, null, null},
|
||||
{null, null, null, null, null, null},
|
||||
{null, null, null, null, null, null},
|
||||
{null, null, null, null, null, null}
|
||||
{null, null, null, null, null, null, null},
|
||||
{null, null, null, null, null, null, null},
|
||||
{null, null, null, null, null, null, null},
|
||||
{null, null, null, null, null, null, null}
|
||||
},
|
||||
new String [] {
|
||||
"Select", "Title 1", "Title 3", "Title 4", "Title 5", "Icon"
|
||||
"Select", "Title 1", "Title 3", "Title 4", "Title 5", "", "Icon"
|
||||
}
|
||||
) {
|
||||
Class[] types = new Class [] {
|
||||
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.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
|
||||
};
|
||||
boolean[] canEdit = new boolean [] {
|
||||
true, true, true, true, true, false
|
||||
true, true, true, true, true, true, false
|
||||
};
|
||||
|
||||
public Class getColumnClass(int columnIndex) {
|
||||
@@ -167,8 +175,9 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
|
||||
jScrollPane2.setViewportView(jTable1);
|
||||
if (jTable1.getColumnModel().getColumnCount() > 0) {
|
||||
jTable1.getColumnModel().getColumn(0).setResizable(false);
|
||||
jTable1.getColumnModel().getColumn(5).setResizable(false);
|
||||
jTable1.getColumnModel().getColumn(5).setPreferredWidth(10);
|
||||
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);
|
||||
@@ -202,9 +211,7 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
|
||||
//table with checkboxes
|
||||
|
||||
public void buildTable(){
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
Date date = new Date();
|
||||
String sDate = dateFormat.format(date);
|
||||
String sDate = getNow();
|
||||
Object[] columnNames = {"Select", "Time", "Device", "Test", "Result", "Status", ""};
|
||||
ImageIcon icon = new ImageIcon("button_play.png");
|
||||
Object[][] data = {
|
||||
@@ -218,7 +225,13 @@ jTable1.setValueAt(icon, rowD, COL_ICON);
|
||||
//jTable1.setModel(model);
|
||||
}
|
||||
|
||||
|
||||
public String getNow(){
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
Date date = new Date();
|
||||
return dateFormat.format(date);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user