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

Allow choosing system LAF on Linux

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      The default System LAF for non gnome linux desktop is Metal. UIManager.getSystemLookAndFeelClassName() - on Linux is set to GTK for gnome desktop - ie. sun.desktop returns gnome - and to Metal for non-gnome desktops.

      This prevents the majority of Java applications to use the native GTK LAF when running.

      Also, UIManager.getSystemLookAndFeelClassName() ignores the default LAF set by the user through swing.defaultlaf (either as a system property or in swing.properties), relying instead on it's own simplified OS/Desktop based heuristics and defaulting to the Cross Platform LAF when those heuristics fail.

      While the Default LAF can be set either as a system property or in swing.properties, the System LAF can only be set as as system property, thus there is no way to assign it system-wide.

      JUSTIFICATION :
      All GUI toolkits on linux platform try to look native, except of swing. It makes hard to produce native looking crossplatform apps.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      There are two config files:
      swing.properties - for preferable LAF.
      swing-system.properties - the LAF which returns JRE after calling method UIManager.getSystemLookAndFeelClassName()
      ACTUAL -
      Currently we can set only preferable LAF

      CUSTOMER SUBMITTED WORKAROUND :
      Use _JAVA_OPTIONS env variable. The downside is that terminal is spoiled with "Using Java Options ..."
      _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'



            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: