-
Junior Member
JTable creation in swing
Hi,
I am using NET BEANS 5.0 and JSDk1.4.2
I need to populate table data in JTable in dynamically manner.
I need code for that.
Any one can help me out.
Regards,
Venkat.GJTable creation in swing
Hi,
I am using NET BEANS 5.0 and JSDk1.4.2
I need to populate table data in JTable in dynamically manner.
I need code for that.
Any one can help me out.
Regards,
Venkat.G
-
Contributing Member
Re: JTable creation in swing
Hi Venkat,
To add data to a table dynamically, you will have to extend javax.swing.table.AbstractTableModel. In this class there is a method called getValueAt(rowIndex, colIndex). This method is a call back method that is called whenever the table is repainted. So you will have to implement this method to return the values. The parameters passed are the rowIndex and the colIndex.
Hope this helps. Consult the Java API's for description of the other methods present in the AbstractTableModel.
Regards,
Sahil.
--Win as if you were used to it,
loose like you enjoyed it for a change!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules