Start a Conversation

Unsolved

This post is more than 5 years old

472393

June 8th, 2015 06:00

Java application scaling issues on 4K m3800 (probably all HiDPI monitors)

Hi,

I recently got a m3800 DE w/ 4K monitor, and am very happy with it so far.  The screen is great, performance has been good, and Ubuntu seems to work very well for the most part.

One of the most pressing issues I'm having so far is not Dell specific, but Ubuntu/HiDPI/Java related, and thus related to both Developer Edition laptops.  For the 3K xps 13 and 4K m3800, proper application scaling is handled by Ubuntu using the System Settings interface, or otherwise through command line.  Java applications, however, do not seem to play nice with these scaling settings.  For example, when I open Matlab, the application opens using a standard 96 dots per inch resolution, thereby resulting in a very small size application.  I can scale up fonts in Matlab to fix many issues, but menus and the interface are still very small.

Does anyone know an (elegant?) way to make Java applications scale properly on a 4K monitor?

Thanks,

Mike

17 Posts

June 8th, 2015 13:00

80 Posts

June 8th, 2015 19:00

I find the pixel density of the 1920x1080 screen at 13" size to be beyond what my eyes can resolve, and my natural uncorrected vision is better than 20/20 both near and far. 4k on a screen this small is ridiculous! Even on a 28" monitor it's overkill. But it's a cool desirable kind of ridiculous overkill for some people.

There are 2 system settings I know of that may help your situation. These exist in the common Ubuntu desktops: Unity, XFCE, etc. You didn't specify which desktop you're using or which setting you changed:

Set Desktop scaling to 2:1 or higher.
Set Font DPI to something huge like 200 or more.

There are also window manager settings for sizes of titlebars, etc.

June 10th, 2015 05:00

I find the pixel density of the 1920x1080 screen at 13" size to be beyond what my eyes can resolve, and my natural uncorrected vision is better than 20/20 both near and far. 4k on a screen this small is ridiculous! Even on a 28" monitor it's overkill. But it's a cool desirable kind of ridiculous overkill for some people.

There are 2 system settings I know of that may help your situation. These exist in the common Ubuntu desktops: Unity, XFCE, etc. You didn't specify which desktop you're using or which setting you changed:

Set Desktop scaling to 2:1 or higher.
Set Font DPI to something huge like 200 or more.

There are also window manager settings for sizes of titlebars, etc.

Desktop SF is 2:1, and font SF is 1.1:1 I believe.

In general, this works really well.  However, some applications such as almost all Java apps, as well as parts of Thunderbird and VLC, don't scale nicely.  In particular, menus.  It seems to be a Java Swing issue, not a laptop issue, but none the less is related to both Developer Edition laptops.

June 10th, 2015 05:00

There are some suggestion at askubuntu.com/.../fix-scaling-of-java-based-applications-for-a-high-dpi-screen

Thanks.  The script as part of the accepted answer seems to function well, but it doesn't really answer my problem.  All that the script does is automate changing the resolution of your laptop from 3840x2160 to 1920x1080 when you open a program.  Not an awful workaround, but certainly not a long-term solution.

I was hoping someone knew a real fix :-/

1 Message

April 6th, 2016 07:00

The solution for applications that do not display correct on 4K screens is to tell the jvm it must NOT run dpi aware. This is done by providing a jvm parameter in the startup script of the java application 

-Dsun.java2d.dpiaware=false

No Events found!

Top