• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable refresh problems

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JTable that looks like it is refreshing every tim that i clink on it.

rowSM.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent e) {
//Ignore extra messages.
if (e.getValueIsAdjusting()){
return;
}
ListSelectionModel lsm = (ListSelectionModel)e.getSource();
if (lsm.isSelectionEmpty()) {
//no rows are selected
} else {
//selectedRow is selected
int selectedRow = lsm.getMinSelectionIndex();
if (GridDisplay.bCabOrUser){
GridDisplay.UserName = (String)tabMain.getValueAt(selectedRow, 0);
GridDisplay.sLoggedOut = (String)tabMain.getValueAt(selectedRow, 2);
}
else if ( ! GridDisplay.bCabOrUser){
GridDisplay.IndexName = (String)tabMain.getValueAt(selectedRow, 0);
GridDisplay.IndexType = (String)tabMain.getValueAt(selectedRow, 1);
Dependancy(GridDisplay.IndexType);
}
}
}
});

that is what i am doing with the listselection listener.
does anyone have an idea as to what i must do?
 
Tys Seyffert
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i had a look now and it seems that sometimes only some columns filcker. by refreshing i meant that it flickers if you select anything in the table. i just dragged the window over it and it flickered as well.
Thanks again
reply
    Bookmark Topic Watch Topic
  • New Topic