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

Deprecate the Swing Motif Look and Feel and document it as unsupported on macOS

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P2
    • Resolution: Approved
    • Fix Version/s: 13
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      Deprecation only at this time.
    • Interface Kind:
      Java API, Other
    • Scope:
      JDK

      Description

      Summary

      This is a request to deprecate the Swing Motif Look and Feel for removal, and document it as unsupported on macOS platform in jdk13.

      Problem

      The Motif L&F has long been part of the Swing implementation shipped with the JDK, although unlike L&Fs such as Metal and Nimbus it is not exposed in Java APIs and not part of the Java SE specification. Because it is an internal class, not exported from the java.desktop module, applications cannot instantiate it directly in JDK 9 and later, but is still accessible via command line option or passing the class name to the method "UIManager.setLookAndFeel(String className)".

      This look and feel was implemented as the System look and feel for the Solaris platform at time when the CDE/Motif environment was used the principal supported desktop environment. Since then it has been largely superseded by the GTK L&F, both on Solaris, and on Linux versions.

      But it was placed in shared code and provided and supported on all platforms including Windows and later MacOS. Applications can enumerate the installed L&Fs via standard API, and retrieve its class name and instantiate it. It has also been documented in tutorials, guides etc.

      However its use as a cross-platform L&F is very limited applications are much more likely to use one of the true cross-platform look and feels which are exposed in Java API, ie

      Since it is superseded as a system L&F and has limited use and additionally as a L&F is very dated visually, we would like to discourage further use.

      Solution

      As of jdk13 in the release notes we would like to document this L&F as unsupported on macOS, and deprecate it for removal in the source code

      In some future release we may remove it completely, or we may remove it from the shared code to stop distributing it on Windows and macOS. These are mentioned here to give the most possible notice of such possible additional changes.

      Specification

      The are no specification changes in the Java API, because the Motif L&F does not have a public api But for the record this change will be done in the source code:

       java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
      
      + * @deprecated The Motif Look and Feel is deprecated with the intent to remove
      + *             it in some future release. It is recommended to use
      + *             {@link javax.swing.plaf.metal.MetalLookAndFeel} instead.
        */
       @SuppressWarnings("serial") // Superclass is not serializable across versions
      +@Deprecated(since="13", forRemoval=true)
       public class MotifLookAndFeel extends BasicLookAndFeel

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                serb Sergey Bylokhov
                Reporter:
                tonyli Tony Li
                Reviewed By:
                Philip Race
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: