JDK-8143406 : HiDPI: should AWT components be harmonized with Swing (taking into account scale factor somehow)?
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2015-11-20
  • Updated: 2016-01-29
  • Resolved: 2015-11-23
Related Reports
Duplicate :  
Description
Sorry, that's may be not an issue, but just in case: should the AWT components be somehow (dynamically) scaled when using HiDPI?

Please compile/run the following simple test app. attached:
jdk/bin/java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtGTKLookAndFeel -Dsun.java2d.uiScale=2 Mix

It seems (Ubuntu 15.04 + GNOME + HiDPI display) that "sun.java2d.uiScale" is used for both AWT and Swing components.

Please try to change scaling-factor, e.g.:
> gsettings set org.gnome.desktop.interface scaling-factor 3

the central (Swing) button's font is obviously changing, whereas for other (AWT) buttons - is not.

Such a behavior may cause some discordance for application containing both AWT + Swing components (mixing)

Another question, just in case. It seems that for Swing component we use scaling-factor multiplied by uiScale - is that what intended?

Checked with: JDK9 b93 and recent (Oct. 17) client build.
Comments
> the central (Swing) button's font is obviously changing, whereas for other (AWT) buttons - is not. this behavior is already described in JDK-8058742. so, closing the issue as duplicate (in fact, some combination of "duplicate" and "not an issue").
23-11-2015

Sorry, this most likely should be closed as not an issue as (looking at JEP 263 more carefully): "Java2D and AWT use the XLib library, which does not support HiDPI. As a result, current Java applications can look 2 to 3 times too small on HiDPI displays on Linux."
23-11-2015

reopening after some refactoring...
20-11-2015