Reputation: 87
I just upgraded from IntelliJ 14 to IntelliJ 15, and now my Java Swing fonts won't load.
I haven't changed any code since I last compiled it, and the program works fine if it is compiled into a Jar, but not through IntelliJ's Run command. I am using Courier as the font (My program needs the font monospace for alignment).
Any ideas why the font wouldn't load between the two versions or between the IDE and JAR?
For the sake of completion, here is the code loading the font:
output = new JTextArea(15,15);
output.setEditable(false);
output.setFont(new Font("Courier", Font.PLAIN,12));
P.S. I couldn't find any other forums that this would fit in, and this is the reverse issue of what I have found on other posts.
Upvotes: 1
Views: 249
Reputation: 87
I realized since IntelliJ's runtime is separate from the regular system so that it can monitor and debug the program, it would not access the system fonts regularly (at least in this new update).
I worked around it by calling for a dynamic font, in this case new Font("Monospaced",Font.PLAIN,12)
. It calls for the best fit font the system can access that is monospace.
Upvotes: 1