Thread: JTable problem
View Single Post
  #2 (permalink)  
Old 05-20-2008, 07:34 PM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
The JTable listens to the TableModel so it can know when to update itself. Use a DefaultTableModel and make data additons/deletions to it. Depending on the methods you use you may have to use a method in the AbstractTableModel class to announce the change(s). The table will hear about the changes.
Put the JTable in a JScrollPane and eliminate the JPanel. Add the scrollPane to the container that you had added the panel to earlier. JTable implements the Scrollable interface so it knows how to communicate with the parent scrollPane.
Reply With Quote