Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8143406

HiDPI: should AWT components be harmonized with Swing (taking into account scale factor somehow)?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 9
    • client-libs
    • None

      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.

            Unassigned Unassigned
            avstepan Alexander Stepanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: