this may look similar to the next message, but it is sorta different
here's what i got:
I got an interface class which has a desktopPane, textfields and buttons in a toolBar
In the dekstopPane, there is an internalFrame. now the internalFrame is in a seperate class which extends JInternalFrame. Inside the internal frame there is a JPanel, which is also another class. in that JPanel class, there is a JTable which reads data from a Vector in the interface class.
when a row on the JTable is clicked, the appropraite data(first name...) is shown in the textFields below. When the user changes the stuff in the textfields and presses the save button on the ToolBar(which is also a sperate class) the new data entered is appended to the Vector.
Now here is the problem:
the data is 150% added to the vector correctly. But, the JTable needs to display the new data.
So what is now happening is that all Internal frames are removed from the desktop, and the InternalFrame(class) is added to the desktop. As you recall from above, the JTable is also added again.
You might be thiking there is somthing wrong with the JTable and that it is not reading the data correctly. (that's what i was thinking) but when i output the data from the table (System.out.print(table.getValueAt(x,y)) the new data is outputed but the table on the screen still displays the old data.
Hope you get the picture~~!
so in general the problem is that the table on the screen does not refresh its display.
But: if i go File.View Member(in the menuBar of the interface) the same procedure takes place(remove all internal frames, add a new one with the JPanel inside in which the JTable is) and the new data is displayed.
I tried: - fireTableXXX(); for the table Model i was using - I got rid of the tablemodel and just used setValueAt(c,x,y) - I used repaint(), updateUI(). no luck - I used the same code in the menubar action listener, which does work when a menu event occurs, but not when it called?? - Used AbstaractTableModel and DefaultTableModel - put in refresh method in the JTable class which gets the data and setValueAt...
Thanks for your time, hope somone can crack this.
P.S. Remember, when i get the data from the table it is the right data, but the displayed data is not, even thought i'm getting it from the same table.
I need some thing that refreshes the JTable, HEELLLP, i don't know what i need, cause if u would have known, i wouldn't be asking thanks.