2 Attachment(s)
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.
Attachment 1995Attachment 1996
Would really appreciate the help.
Thanks
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?
Re: adding string to JextPane