Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Handle Resizing of Containers

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...deleted...

http://www.java-forums.org/awt-swing/25853-handle-resizing-swing-containers.html
 
S Lei
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I didn't knew this is discouraged. Will continue to ask on the other board :/
 
Sheriff
Posts: 22573
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic