Changing the output font in java's swing
The subject pretty much explains my problem...I need to change the font that swing uses to output in a JTextArea. Im not sure what the default is, but it doesn't use an equal space for every character, which i need. Please help!
You can call the setFont(Font) function on the JTextArea to set the font.
To make a font with the same width for every character, do something like:
Font myFont = new Font("Monospaced", Font.PLAIN, size);
For the size parameter, choose whatever font size you want. Something like 10 or 12 will work probably.
To make a font with the same width for every character, do something like:
Font myFont = new Font("Monospaced", Font.PLAIN, size);
For the size parameter, choose whatever font size you want. Something like 10 or 12 will work probably.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement