• 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

Is a table listener needed to update a JTable?

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

I've been having a problem refreshing data in my JTable, and everyone says to use

fireTableDataChanged();

However, the API doc for this method says

void fireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed.

So heres my question: Do I need to register/create a table listener? And if so, how do I do it?

Code example would be perfect!

Thanks!
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sean,

Two TableListeners are added implicitly to the JTable when you created it, as such there is no need to add your own Listeners, unless you want other custom actions to be performed when the fireTableDataXXX method is invoked.

Regards,
Clivant
reply
    Bookmark Topic Watch Topic
  • New Topic