Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Propagating JPanel changes to ancestors  RSS feed

 
Pieter-Jan Malfait
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Is there a clean way to propogate changes made to a JPanel (components being added,removed, resized..) to the ancestors, preferrably the top-level (internal) frame so i can call pack() to make it resize..

i was planning on building a system my self based on some kind of LayoutChangeHandler interface that you can register on a panel but wanted to check first if there wasn't something built in already

thanks a lot in advance!
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.awt.event.ComponentListener for resizing, moving, showing and hiding of components.
java.awt.event.ContainerListener for adding and removing components to and from a container.
The latter gives you a ContainerEvent which even tells you which Component was added/removed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!