update JTable

Hi all,

I have a JTable in a JPanel, and the content of JTable is changing from time to time. I use following: javax.swing.JTable myTable =

new javax.swing.JTable(myVector, elementNames);

jScrollPane = new javax.swing.JScrollPane(myTable);

jScrollPane.getViewport().setViewPosition(new java.awt.Point(0,0));

add(jScrollPane);

Another method

public void updateTable(java.util.Vector oneLine, int index)

{

myVector.setElementAt(oneLine, index);

}

changes the content of myVector.

However, the content of JTable will not be automatically updated as I respected. Could some one tell me how can I update the JTable when a new line was appended?

Any suggestions will be greatly appreciated. Thanks!

eedych

[809 byte] By [eedych] at [2007-9-26 2:05:36]
# 1
You must call revalidate() Method of Frame object !Regard Shekoff
shekoff at 2007-6-29 8:50:48 > top of Java-index,Archived Forums,Java Programming...