Table basic implementation

This commit is contained in:
Karl Tauber
2019-09-02 22:17:00 +02:00
parent d81e07f03a
commit 122afeb973
7 changed files with 78 additions and 5 deletions

View File

@@ -178,18 +178,18 @@ public class FlatComponents2Test
//---- table1 ----
table1.setModel(new DefaultTableModel(
new Object[][] {
{"Item 1a", "Item 2a", "January", "July", null},
{"Item 1b", "Item 2b", "February", "August", true},
{"Item 1a", "Item 2a", "January", "July", 123, null},
{"Item 1b", "Item 2b", "February", "August", 456, true},
},
new String[] {
"Not editable", "Text", "Combo", "Combo Editable", "Boolean"
"Not editable", "Text", "Combo", "Combo Editable", "Integer", "Boolean"
}
) {
Class<?>[] columnTypes = new Class<?>[] {
Object.class, Object.class, String.class, String.class, Boolean.class
Object.class, Object.class, String.class, String.class, Integer.class, Boolean.class
};
boolean[] columnEditable = new boolean[] {
false, true, true, true, true
false, true, true, true, true, true
};
@Override
public Class<?> getColumnClass(int columnIndex) {

View File

@@ -131,6 +131,7 @@ new FormModel {
add( "Item 2a" )
add( "January" )
add( "July" )
add( 123 )
add( null )
} )
add( new java.util.Vector {
@@ -138,6 +139,7 @@ new FormModel {
add( "Item 2b" )
add( "February" )
add( "August" )
add( 456 )
add( true )
} )
}, new java.util.Vector {
@@ -145,12 +147,14 @@ new FormModel {
add( "Text" )
add( "Combo" )
add( "Combo Editable" )
add( "Integer" )
add( "Boolean" )
}, new java.util.Vector {
add( null )
add( null )
add( class java.lang.String )
add( class java.lang.String )
add( class java.lang.Integer )
add( class java.lang.Boolean )
}, new java.util.Vector {
add( false )
@@ -158,12 +162,14 @@ new FormModel {
add( null )
add( null )
add( null )
add( null )
}, new java.util.Vector {
add( null )
add( null )
add( new com.jformdesigner.model.SwingTableColumn( new java.lang.Object[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], 0, 0, 0, true ) )
add( new com.jformdesigner.model.SwingTableColumn( new java.lang.Object[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], 0, 0, 0, true ) )
add( null )
add( null )
} )
"autoCreateRowSorter": true
} )

View File

@@ -181,7 +181,10 @@ TabbedPane.contentAreaColor=bbbbbb
#---- Table ----
Table.rowHeight=25
Table.background=fffff0
Table.sortIconColor=ffff00
Table.gridColor=00ffff
#---- TableHeader ----