Results 1 to 7 of 7
  1. #1
    jamborta is offline Member
    Join Date
    Dec 2007
    Posts
    6
    Rep Power
    0

    Default displaying string

    hi,

    i'm quite new in java, just started to program in swing. one problem i really couldnt solve is that i have a string which i used to display output messages in text mode, it was alligned by adding spaces to them, however it doesnt work in graphical mode cos the spaces have a narrower width than the characters, so the columns are crooked, even if i try to display it in text box. any idea how i could solve it without reconstructing the original output?

    thanks for your help,
    tom

  2. #2
    Join Date
    Dec 2007
    Posts
    24
    Rep Power
    0

    Default

    put ur code i cant getting ur answer

  3. #3
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    Try using a monospaced font.

  4. #4
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Smile What about tabs?

    You can try using tabs.

    You can align text of different fonts by using tabs. The escape character for a tab is "\t".
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  5. #5
    undertow's Avatar
    undertow is offline Member
    Join Date
    Jan 2008
    Location
    Colorado USA
    Posts
    12
    Rep Power
    0

    Default

    java text components also like html. ;-) ;-)

  6. #6
    caixiao1986 is offline Member
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    Default

    i just want to say hello 您好!

  7. #7
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Welcome caixioa! There's an Introductions forum too you could've said hello in... but anyways, welcome to our community. :)

    See you around.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

Similar Threads

  1. Displaying characters in many ways.
    By TampaTechGuy in forum New To Java
    Replies: 7
    Last Post: 01-02-2008, 10:16 PM
  2. Displaying different image types
    By splinter64uk in forum AWT / Swing
    Replies: 1
    Last Post: 12-05-2007, 09:12 AM
  3. Replies: 0
    Last Post: 11-20-2007, 05:59 PM
  4. Displaying charts in a jsp
    By Priyanka in forum Java Servlet
    Replies: 1
    Last Post: 11-16-2007, 11:59 AM
  5. Images not displaying in JSP in IE7
    By chadscc in forum Advanced Java
    Replies: 0
    Last Post: 11-13-2007, 04:24 PM

Posting Permissions

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