I am climbing the java learning curve, and for the first time I need a JTable. What I would like to do is display an empty table, with all cells vacant except for column headings. Then as a result of user actions, the tables is filled with a mix of strings, integers, and floats.
All the examples I find on the web create tables that are populated at instantiation. Is there any simple way to defer populating the table, but displaying it at startup?
Thanks in advance for any help.
Create a table model with the specified number of rows and columns and use that for your JTable. For example:
You can then call methods on the model to update values, add rows etc.