Register JRE's L&F impls under META-INF/services/javax.swing.LookAndFeel

XMLWordPrintable

      The JRE includes several Swing look & feel implementations, but it fails to provide any mechanism to autodiscover the L&Fs which are actually available at runtime. The normal way of doing this is using the JAR services notation. Therefore, one would expect rt.jar to contain an entry such as

      ---%<--- META-INF/services/javax.swing.LookAndFeel
      javax.swing.plaf.metal.MetalLookAndFeel
      com.sun.java.swing.plaf.motif.MotifLookAndFeel
      com.sun.java.swing.plaf.windows.WindowsLookAndFeel
      com.sun.java.swing.plaf.gtk.GTKLookAndFeel
      ---%<---

      And of course third-party L&F impls should include their own service registrations.

      This convention permits creation of a generic L&F switcher control which can discover any available options automatically. There is such a module written for NetBeans:

      http://contrib.netbeans.org/plafswitcher/

            Assignee:
            Unassigned
            Reporter:
            Jesse Glick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: