Home > Back-end >  Java - JTextArea refuses to print strings that are just whitespace
Java - JTextArea refuses to print strings that are just whitespace

Time:12-21

I have written a command terminal using Swing components. The snippets of code below contain everything I think could be part of the problem. What is happening is in Snippet #1, when I call printBoard(), it ignores the whitespace in the values[][] array. I tried switching to String[][] instead of char[][] but it didn't work.

If you need more information, please ask. Thanks for your help!

EDIT: enter image description here

You need to make use of a monospaced font in order to ensure that all the characters have equal widths

  • Related