Results 1 to 8 of 8

Thread: Text formatting issue

  1. #1

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Text formatting issue

    Here is an example of how my output looks like:

    | 217543 | Essen-Kettwig | Other | Germany |
    | 217567 | Neustadt | Rheinland-Pfalz | Germany |
    | 217585 | Crottendorf | Sachsen | Germany |


    as you can see they dont line up exactly. Whats an easy way for me to format these so they line up perfect? So they are more readable. Thanks

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Text formatting issue

    use \t tabs
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    Re: Text formatting issue

    Between each two segments of letters/digits.
    “victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha

  4. #4

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: Text formatting issue

    i tried this with no success:

    Code:
    while (st.hasMoreTokens()) { model.addElement("|" + st.nextToken() + "\t"  + "|" + st.nextToken() + "\t"  + "|"  + st.nextToken() + "\t"  + "|" }
    did I do something wrong?

  5. #5
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Text formatting issue

    Are you sending the text to the console or is this in a textarea?

  6. #6

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: Text formatting issue

    im creating a model and then setting it to a jList, so I can see the items in a list box. I want them to look nice in the list box

  7. #7
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Text formatting issue

    If you want it to look nice go for a JTable. It will align the items for you in a nice fashion.

  8. #8

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: Text formatting issue

    wow, I didnt even notice that there. i'll change it around, thanx

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