Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

handling component paint  RSS feed

 
alfredo navarra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to do something that seems hard to me but I'm sure someone of you has got the solution:
I have a LayeredPane that contains a ScrollPane.
In LayeredPane first I create the ScrollPane than I fix dimensions for LayeredPane (this is due to the fact that I'd like to make possible setting dimensions of the component in design and not into the code).
In this way I can't read from within ScrollPane the dimensions of its container!
I'm looking for the way to get dinamically the dimension of the container to adapt dimensions of component inside...
Thank you all. Bye
Alfredo
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can attach a ComponentListener to the component that is changing size and have it tell the other component.
 
alfredo navarra
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you,
I tried with ContainerListener and it worked but ComponentListener seems to be better since my solution was just a workaround...
bye,
alfredo
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!