Results 1 to 3 of 3
Thread: Updating the existing JTable !
- 04-07-2010, 07:54 PM #1
Updating the existing JTable !
Hello:) I need to update the JTable i created using the ide which created the code something like. this...
Java Code:jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { " INVOICE_TYPE", " CUSTOMER_ NAME ", " CUSTOMER_ADDRESS", " TIN_NUMBER" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean [] { false, false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jTable1.setRowHeight(20); jScrollPane1.setViewportView(jTable1); jPanel5.add(jScrollPane1, java.awt.BorderLayout.CENTER); jTabbedPane1.addTab("EXTEND", jPanel5); getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);
Now i need to update this existing JTable.. I have no idea how to do that.. have been trying things.. but none seems to be working..
please suggest.:confused:The Quieter you become the more you are able to hear !
- 04-07-2010, 08:38 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Also there is no need for initializing the table like that. Read the DefaultTableModel API for a constructor that allows you to specify the column names and the number of empty rows.Java Code:table.setValueAt(...);
- 04-07-2010, 08:38 PM #3
Similar Threads
-
Problem with updating JTable
By kwaspl in forum New To JavaReplies: 2Last Post: 12-20-2009, 10:41 PM -
Get CSS/ Use existing CSS
By karthikeyan_raju in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 10-21-2009, 05:24 PM -
Is there a way for updating JTree and JTable with a same model?
By Melki in forum AWT / SwingReplies: 0Last Post: 08-29-2008, 12:49 PM -
Is there a way for updating JTree and JTable with a same model?
By Melki in forum AWT / SwingReplies: 0Last Post: 08-29-2008, 12:16 PM -
Updating database table from JTable
By yesjava in forum New To JavaReplies: 1Last Post: 08-16-2008, 10:16 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks