Results 1 to 2 of 2
  1. #1
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation JTable update...

    Greetings,

    I have been trying to trigger an update when a change on a cell of the JTable.
    There are some columns which has a JComboBox as cell editor.

    Upon the initializing of the class, I have set the model of the JTable using DefaultTableModel with the proper fields.
    After, I have set the JTable with a TableModelListener which triggers any update on the JTable cell.

    Java Code:
    JTable table = new JTable();
    table.setModel(new DefaultTableModel(...));
    table.getModel().addTableModelListener(new TableModelListener() ... );
    Your response is highly appreciated.

    Thanks,
    Cyril H.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  2. #2
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    I think I have got the answer with regards to updating the cell.
    But I have a problem with display the details.
    I used DefaultTableModel and override the setValueAt method which triggers a fireTableCellUpdated()

    But the problem now is that, the updated data, row won't display anything except "".
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

Similar Threads

  1. update jtable?
    By realosso in forum New To Java
    Replies: 0
    Last Post: 08-03-2010, 12:31 PM
  2. update jtable with filter
    By simo_mon in forum AWT / Swing
    Replies: 7
    Last Post: 06-15-2010, 05:53 AM
  3. How to update JTable contents
    By chyrl in forum AWT / Swing
    Replies: 10
    Last Post: 04-17-2010, 06:26 AM
  4. Update JTable data
    By DC200 in forum AWT / Swing
    Replies: 8
    Last Post: 03-30-2010, 11:10 PM
  5. Update the GUI in JTable
    By itaipee in forum AWT / Swing
    Replies: 3
    Last Post: 04-12-2009, 01:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •