What you can do is to create an instance of a Vector, HashTable or
HashMap and then get user inputs and store it in one of the above.
Later you populate JTable with the values.
You can also get the user input and add it to the array. In this case
you have to create (example a text file) and write to it for storage.
Example ;
Vector table = new Vector();
or
HashMap hm = new HashMap();
The best way is to use a pure database sofware like Oracle, Ms Sql, Mysql (this is free), ms Access and many more. In this case you edit your tabel and let the DAtabase program take care of the storage (of course you have to use sql commands).
For the mean time take a look at suns Insertion of row example:
http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/sample.html
Hope this helps
Bashiro
:
: What I mean is that if you've got a table, like the one below ...
:
:
http://java.sun.com/docs/books/tutorial/uiswing/components/example-swing/SimpleTableDemo.java
:
: ...and I want to add another person to the list. I suppose you could equate it to adding another record to a database. With JList or JComboBox you can use .addItem or something, but I can't find anything equivalent for a JTable.
:
:
:
: : Are you talking of how to add records data to the table ?
: : I am asking this because when you add a record into a
: : table with columns a row is automaticallt generated to
: : add the recods.
: :
: : Or did I misunderstood ?
: :
: : bashiro
: :
: :
: : :
: : : Is there any way to add a row to a JTable at Runtime? I see that there is an addColumn and a columnAdded method, but nothing for Rows.
: : :
: : : Anybody got any ideas? I basically just need a multi field list to hold a list of variables and there values.
: : :
: : : TIA
: : : Jake
: : :
: :
: :
:
: