Results 1 to 3 of 3
  1. #1
    SankaR7 is offline Member
    Join Date
    Nov 2011
    Rep Power

    Lightbulb adding string to JextPane

    I am to add a string that show the face of a dice using asterix and spaces.
    I created a new text pane and used the method setText to add the String to the pane.
    But when the string is shown it does not show the same as it does when i just out the String using System.out.println().
    I guess this may have to do with the formatting of the characters or something like that but i have no clue and can't find how to fix this.
    Does anyone know how i can get the out in the text pane to look the same?

    Here are some picture to show what i mean:
    The green one is from using System.out.println()
    The blue one is from using the textPane.

    adding string to JextPane-picture1.pngadding string to JextPane-picture2.png

    Would really appreciate the help.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default Re: adding string to JextPane

    Are you using a JTextPane? If so, why? If not, what exactly are you using? Why not simply use a JTextArea and set the font to Font.MONOSPACED?

  3. #3
    SankaR7 is offline Member
    Join Date
    Nov 2011
    Rep Power

Similar Threads

  1. adding numbers in a string?
    By brycepower1 in forum New To Java
    Replies: 14
    Last Post: 08-19-2011, 05:39 PM
  2. Replies: 1
    Last Post: 04-05-2011, 08:58 PM
  3. Replies: 6
    Last Post: 03-21-2011, 02:27 PM
  4. adding in array String
    By Mekonom in forum New To Java
    Replies: 4
    Last Post: 12-10-2009, 04:28 PM
  5. adding <br> html tag to string
    By newbieal in forum New To Java
    Replies: 7
    Last Post: 10-14-2008, 02:51 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