wood burning stoves 2.0
The moose likes Swing / AWT / SWT and the fly likes JLabel and text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JLabel and text" Watch "JLabel and text" New topic

JLabel and text

jonas okwara
Ranch Hand

Joined: Jun 22, 2004
Posts: 58
How can I add three rows of text to a JLabel();. what I have done so far is to add the each row of text to a JLabel object,add the label objects to a pane with a "GridLayout(0,1)". I tried a BoxLayout but the gaps between the rows was much .

Please is there a better way of doing this.


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
jonas okwara
Ranch Hand

Joined: Jun 22, 2004
Posts: 58
I am using the setText() method of the JLabel object. Can your solution factor into this.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Swing / JFC / AWT forum...

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
jQuery in Action, 3rd edition
subject: JLabel and text
It's not a secret anymore!