JTable entry modification
I have a Jtable and some values in it. and I displayed it. Once after displaying this Jtable, I have a Jcombobox below this Jtable and If I select this combobox to a different value, I should be able to display some other values from a string array on the same Jtable. Is it possible to do this without creating a new Jtable?
Or do I need to recreate this JTable with the new values and close the old Jtable.
Thanks in Advance
Re: JTable entry modification
Create a custom TableModel (the AbstractTableModel and DefaultTableModel classes are handy to do so - just override/implement the appropriate methods). You can then have logic in the getValueAt method to return the appropriate value based upon what the user selection is. When the item in the ComboBox is selected, call the fireTableDataChanged method. The following link has information for how to accomplish this.
How to Use Tables (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)