How to display the texts into 2 line in JButton?

Discussion in 'Java' started by James, Nov 11, 2003.

  1. James

    James Guest

    hi, I am newbies here.
    I want to display 2 words in jbutton but if I use setText("Add Record");
    When display, it show Add record (in a line)
    I want it display as
    Add
    Record
    (2lines)
    in jbutton?
    How to do that?
     
    James, Nov 11, 2003
    #1
    1. Advertising

  2. James schrieb:

    > hi, I am newbies here.
    > I want to display 2 words in jbutton but if I use setText("Add Record");
    > When display, it show Add record (in a line)
    > I want it display as
    > Add
    > Record
    > (2lines)
    > in jbutton?
    > How to do that?
    >
    >
    >

    setText("<html>Add<br>Record</html");
     
    Thomas Kellerer, Nov 11, 2003
    #2
    1. Advertising

  3. James

    Moshe Sayag Guest

    For more detailed information check out the following "Tech Tips" from Sun:

    "Displaying Multiline Text"
    http://developer.java.sun.com/developer/JDCTechTips/2002/tt0723.html#tip2

    Moshe

    James wrote:

    > hi, I am newbies here.
    > I want to display 2 words in jbutton but if I use setText("Add Record");
    > When display, it show Add record (in a line)
    > I want it display as
    > Add
    > Record
    > (2lines)
    > in jbutton?
    > How to do that?
    >
    >
    >
     
    Moshe Sayag, Nov 11, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cloud Burst

    can JButton text span a line?

    Cloud Burst, Dec 15, 2003, in forum: Java
    Replies:
    3
    Views:
    3,077
    Alex Hunsley
    Dec 15, 2003
  2. Replies:
    5
    Views:
    3,053
    Andrew Thompson
    Dec 26, 2005
  3. Replies:
    1
    Views:
    1,377
  4. Gelonida N
    Replies:
    2
    Views:
    273
    Michele Simionato
    Sep 28, 2011
  5. Peter Vereshagin
    Replies:
    3
    Views:
    169
    Dr.Ruud
    Mar 17, 2011
Loading...

Share This Page