Sign in to follow this  
K4MEl30N

Changing the output font in java's swing

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this