• Post Reply Bookmark Topic Watch Topic
  • New Topic

Refreshing JTable  RSS feed

 
Mohammed J Abbas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I have a JPanel which searches queries from the internet. The action requires the user to enter a query and click a button to have the table displayed on the screen.
I have tried using some TableSelectionModel methods( firetabledatachanged(), firetablechanged(...) etc. but to no avail.
p.s. Maybe it has something to do with listeners to the main.
I'll try to drop the code at a later time.
I would like to hear your comments??
Yours
Mohd
 
Mohammed J Abbas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mohammed J Abbas:
Dear All,
I have a JPanel which searches queries from the internet. The action requires the user to enter a query and click a button to have the table displayed on the screen.
I have tried using some TableSelectionModel methods( firetabledatachanged(), firetablechanged(...) etc. but to no avail.
p.s. Maybe it has something to do with listeners to the main.
I'll try to drop the code at a later time.
I would like to hear your comments??
Yours
Mohd

 
Mohammed J Abbas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I have a JPanel which searches queries from the internet. The action requires the user to enter a query and click a button to have the table displayed on the screen.
I have tried using some TableSelectionModel methods( firetabledatachanged(), firetablechanged(...) etc. but to no avail. I keep on having to rezise the frame which contains the component to notice any changes.
p.s. Maybe it has something to do with listeners to the main.
I'll try to drop the code at a later time.
I would like to hear your comments??
Yours
Mohd
------------------------------->
public void tableChanged(TableModelEvent e)
{
table.repaint();

}

public void actionPerformed(ActionEvent event)
{
//The Button action when the Search Button is pressed
else if(event.getSource() ==button1)
{
this.remove(scrollPane);
stm = new SearchTableModel(rows, columns);
stm.fireTableDataChanged();
table = new JTable(stm);

scrollPane = new JScrollPane(table);
this.addComponent( scrollPane);
repaint();
}
------------------------------->
Im open to any suggestions cause Im out of Ideas??
Please help me....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!