![]() |
table=new JTable(values,new String []{"Property", "Value"});
With this simple JTable constructor, any array can be put into a table. Modification to the data is much more intuitive with the GUI when aligned in a table.
getValueAt(int, int).
propertyName=(String)table.getValueAt(i,0);
Shown below is a still image of Java application
EditProperties, which uses the above function calls. The table contains
the name of the properties and their values, which can be modified
within each cell of the table. Press Save button when
you finish the edit and the properties will be returned. Click
the link below for the jar file.
Download: easai.jar Source: EditProperties.java
In the application EditProperties above, there is one
more line added to reflect the changes to the table.
stopCellEditing() function call.
table.getCellEditor().stopCellEditing();
Please refer to Class Properties: How to Manage Class Variables page on how to save and load the property values.
Let's not reinvent the wheel. Let's explore the world that Java can offer, with its rich sets of program libraries and extendable object oriented paradigm.