18

Is there a way to increase the default font size for Java GUI applications?

I am using someone else’s custom Java tool (no, I do not have the source) to perform text annotation for a research project.

The text within the application is painfully small.

For most Windows applications, changing the system font size settings in the control panel will also change the font size in that application.

However, after increasing the default text size (on Windows 7), the text in this Java application remains excruciatingly small.

3
  • This is a problem with high resolution displays. Programs like eclipse, blender and mendeley are difficult to use (all with java GUIs). This is a problem also with windows 8. I am adding a bounty.
    – Juha
    Commented May 31, 2014 at 21:56
  • correction to previous: blender is actually not java... although it has similar problem, (font) scaling is not inherited from operating system
    – Juha
    Commented May 31, 2014 at 22:14
  • If the app uses Swing, then it should inherit larger font settings. Anyway it would be great to know (or at least make a guess) which GUI framework uses the app in question. Can you post the screenshot? Commented Jun 4, 2014 at 6:29

2 Answers 2

7

For what it's worth, I have seen command-line switches that relate to specific packages.

Swing

java -Dswing.aatext=true -Dswing.plaf.metal.controlFont=Tahoma -Dswing.plaf.metal.userFont=Tahoma

Plastic

java -DWindows.controlFont=Tahoma-plain-11 -DWindows.menuFont=Tahoma-plain-12 -DPlastic.controlFont=Tahoma-plain-11 -DPlastic.menuFont=Tahoma-bold-11
3
  • How do I set these parameters? Should I run the application with a different way? What if I don't know if the application is written in Swing ? What if I don't know if the application is written in Plastic ?
    – thanos.a
    Commented Mar 31, 2017 at 9:24
  • @thanos.a: These are separate questions that you could put up in a new post.
    – harrymc
    Commented Mar 31, 2017 at 9:33
  • For Java Swing, I also added -Dawt.useSystemAAFontSettings=lcd. Although I cannot tell the difference between awt & swing in Java, it gave me even better results.
    – Krackout
    Commented Nov 22, 2022 at 14:39
8

Under Windows 10, this could be easily done:

  • select jawaw.exe (or jawaws.exe for jnlp files), it is usually under c:\Program Files (x86)\Java\jre1.8.0_171\bin\
  • Right-click and select Properties.
  • Click the Compatibility tab. Under "Settings," check the Override high DPI scaling behavior option.
  • Under "Scaling performed by" drop-down menu, select System (Enhanced).

You have to repeat this after updates or create a shortcut. (source:windowscentral.com)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .