• 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

How do I find out if a change has been made on a panel

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got a panel (we'll call him "George") that contains relationships to several child panels (we'll call each of them "Junior"). Each of these child panels contain components ranging from JTextFields to JLists to JRadioButtons to Custom Components. Is there a way to wire up a Listener of some type on each "Junior" so that it will capture a change to any of its sub components? The listener would set a Dirty flag so that "George" knows he should enable the save button when control returns to him.

I know I could pop a listener on each of the Field level components on each of the panels, but I would like to set the listener up at the panel level if possible. That way I could reuse the same code on each panel and any new panels that are added without having to worry about what types of components that panel contains.

Thanks for any insight you can provide.

Chris
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am pretty sure there isn't anything built into the API for this. There is a ContainerListener and a ComponentListener but all they do is tell you when something is added, removed, or moved.

There still has to be some way for your child components of Junior to notify Junior that something about them has changed aside from the actions I mentioned above.
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic