The Artima Developer Community
Sponsored Link

Java Answers Forum
Is there a JParagraph?

1 reply on 1 page. Most recent reply: Jun 23, 2004 12:31 AM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Gibran Shah

Posts: 27
Nickname: gibby
Registered: Jun, 2004

Is there a JParagraph? Posted: Jun 20, 2004 9:15 AM
Reply to this message Reply
Advertisement
I'm wondering if there's a swing item that's like a JLabel except that it spans many lines, like a JParagraph. If I write

JLabel L = new JLabel("line 1\nline2");

What gets displayed in the interface is "line 1line 2" (i.e. the '\n' gets trashed). I'd like to know if there's anything that will take the '\n' into account and span several lines.

Gib


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Is there a JParagraph? Posted: Jun 23, 2004 12:31 AM
Reply to this message Reply
In jdk 1.4 version few html tags are supported in JLabel.

So use

JLabel L = new JLabel("<html>line 1 <br/> line2 </html>");

and it will have two lines in JLabel.

Else u can write ur own component say JParagraph extending ScrollableComponent or any simly Component

Flat View: This topic has 1 reply on 1 page
Topic: CORBA.NO_IMPLEMENT Previous Topic   Next Topic Topic: Network Authentication

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use