CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 1999
    Location
    usa
    Posts
    33

    make a jlabel span multiple lines ?

    can i make a jlabel that span multiple lines ?

    it displays lines on top of other lines.

    that's all.


    thanks in advance.

    http://members.xoom.com/lookads

  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: make a jlabel span multiple lines ?

    There is a article on this site I think at
    http://codeguru.developer.com/java/swing

    This is a enhanced JLabel component which shows label on multiple lines. See if its useful for u.

    - UnicMan
    http://members.tripod.com/unicman

  3. #3
    Join Date
    Apr 1999
    Location
    Bangalore,India
    Posts
    43

    Re: make a jlabel span multiple lines ?

    U have to use Swing1.1.1 for this where u can use html statements for your label.
    Use
    to achieve your multi line label.

    regards,
    arun...


  4. #4
    Join Date
    Oct 1999
    Location
    usa
    Posts
    33

    can you give me a short example ?

    can you give me a short example ?

    how do i put html in my jlabel.

    i thought jlabel only displays a single line of code ?

    thanks

    http://members.xoom.com/lookads

  5. #5
    Join Date
    Apr 1999
    Location
    Bangalore,India
    Posts
    43

    Re: can you give me a short example ?

    Hi,

    Here it is. U have to use Swing1.1.1 for this case. Because only this supports HTML.

    String htmlText = "<html>MultiLine JLabel
    one
    two";
    JLabel myLabel = new JLabel(htmlText);




    I have used "break" between "JLabel" and "one" as well as between "one" and "two". The html equivalent for "break"
    is not coming in the preview. So I have given the explanation as above.

    It supports all valid html tags too. The JVM constructs a lightweight HTML document, when the the String for the JLabel
    begins with "<html>"

    Hope will help u.

    regards,
    arun...



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured