| Author |
setting up the size of a JTable to the size of a vector
|
clare summers
Greenhorn
Joined: Feb 19, 2003
Posts: 3
|
|
Hi I want to read in a file when the focus is lost behind JTextfield1 and when i read in this file i want to be able to set up the JTable to the size of the vector. Could anyone help please? thanks C
|
 |
Jason Moors
Ranch Hand
Joined: Dec 04, 2001
Posts: 188
|
|
Hi Clare, The easiest way is to create a two dimensional array from your vector and then create a new JTable using the following constructor. However a better method would be to extend the TabelModel. If you need an example let me know! Jason.
|
 |
clare summers
Greenhorn
Joined: Feb 19, 2003
Posts: 3
|
|
Hi jason Thanks for the reply Yes could you please give me an example Thanks c
|
 |
Jason Moors
Ranch Hand
Joined: Dec 04, 2001
Posts: 188
|
|
Hi Clare, I've modified a AbstractTableModel that I've used for reading a variable length CSV file. You need to create an instance of the model and then pass the model in the JTable constructor. e.g Hope it helps! Jason.
|
 |
 |
|
|
subject: setting up the size of a JTable to the size of a vector
|
|
|