• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Christopher Elkins
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • 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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!