• Post Reply Bookmark Topic Watch Topic
  • New Topic

Handle Resizing of Containers  RSS feed

 
S Lei
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I hope you know the answer to my beginner question -- I have a JButton, which has an Image drawn to it. Now I tried to apply a Layout to this Button and the whole rest of my formular, and this works fairly good. The Button is resizing when I resize the Window. But I wish to make the Image on the Button smaller, when the Button shrinks, and bigger, when the button gets bigger. Is there any possibility to do this without too much hassle? Is there an autofit setting, or another way to get notified anytime the button gets resized?
When there is such a notification: How do I get the size the button is tried to be resized to? Just with getSize()?
And talking about "best practice" -- yea, what would the best practice be here?

I hope this question doesn't annoy you too much; I am a total GUI beginner :/
Thank you very much!

Simon L.
 
Michael Dunn
Ranch Hand
Posts: 4632
 
S Lei
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I didn't knew this is discouraged. Will continue to ask on the other board :/
 
Rob Spoor
Sheriff
Posts: 20903
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BeForthrightWhenCrossPostingToOtherSites
We don't disallow it, we just want you to be honest both here and on the other board that you've asked the question elsewhere.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!