How do I make a JLabel 40 characters (for example) wide? If I instantiate it with a huge long empty string it still scrunches up to a relatively small size. When I setText() into it, it sticks it so far over to the right of the JLabel, I usually can't see it. Thanks! Paul
Jeff Wisard
Ranch Hand
Joined: Jan 07, 2002
Posts: 89
posted
0
I would play around with alternate layout managers if I were you. Although it is the most complex, GridBagLayout is the most powerful layout manager and you could definetely work this out using one. You could probably do this also with BorderLayout, GridLayout, or even a FlowLayout. You may have to use multiple layouts to get the desired effect. Just play with it! Hope this helps!
Jeff Wisard<br />Sun Certified Java Programmer (Java 2)<br />Sun Certified Web Component Developer
Paul Stevens
Ranch Hand
Joined: May 17, 2001
Posts: 2823
posted
0
Try setMinimumSize() it won't let it go less than that size. setPreferredSize() might work.