Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resizing Label

 
Matthew Gaunt
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my applet, I have two components. One of them goes in the centre and the other is a Label component being placed at the NORTH edge of the applet.
I know that the applet has a BorderLayout, so the width of the label is determined by the width of the applet.
The question is, can I set the height of the label, or will it only ever be displayed within the applet at the label's preferred height. If I can set it, then how, since everything I have tried does not seem to work.
Best Regards
Matt Gaunt
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew,
I've tried lots of things, and here's the only thing that I've found that works... creating a subclass of Label that sets it's size itself... you might want to expand upon this idea and make the size changes dynamic ( i.e. add methods so you can set height and width without hard coding it in... )

HTH,
-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic