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

SwingSet2 demo should use UIManager.getInstalledLookAndFeels( )

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 1.4.0, 1.4.2
    • client-libs
    • generic, x86
    • generic, linux

      Name: krC82822 Date: 08/26/2001


      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

      I think that the SwingSet2 demo should use
      UIManager.getInstalledLookAndFeels( ), in order to get the look and
      feels available. it should not use a fixed list of look and feel, written in
      the source code, as it does now.

      This is because i've been using a swing.properties file: I can use this
      file to add new look and feel to the J2SE/JDK, so i've tried some swing apps with a
      new look and feel. as an example jbuilder 5 works perfectly, swingset2 don't
      (in the sense that the new look and feel isn't listed among the options).

      --------

      26 Aug 2001, eval1127@eng -- see also # 4421177.

      (Review ID: 130687)
      ======================================================================

      Name: jl125535 Date: 03/23/2004


      I have attached a patch for a modified version of SwingSet2.java that reads the list of L&Fs from the properties file, including which one is to be the default.

      This will allow me (and others) to distribute only a new properties file for SwingSet2 to work with any L&F. This is good for me as for testing my L&F, and for showing it off to others. It is a realtively simple modification and makes the demo a much more powerful tool for showing the power of the pluggable look and feel framework.


      ---------- BEGIN SOURCE ----------
      Below is the relevant modified portion of the swingset.properties file. The changes are to add a new field LafMenu.laf_list that contains the names of the property groups for the look and feels that will be shown, and a new property LafMenu.laf_default to name which will be the default on launch. The names in the list are used to derive a set of names for the menu properties -- for example, the presence of the word "napkin" in the list means that SwingSet2 will look for the properties LafMenu.napkin_label, LafMenu.napkin_mnemonic, etc.

      LafMenu.laf_label=Look & Feel
      LafMenu.laf_mnemonic=L
      LafMenu.laf_accessible_description=Menu that allows Look & Feel switching
      LafMenu.laf_list=java mac motif windows gtk napkin
      LafMenu.laf_default=napkin

      LafMenu.java_label=Java Look & Feel
      LafMenu.java_mnemonic=J
      LafMenu.java_accessible_description=The Java Look & Feel
      LafMenu.java_class=javax.swing.plaf.metal.MetalLookAndFeel

      LafMenu.mac_label=Macintosh Look & Feel
      LafMenu.mac_mnemonic=M
      LafMenu.mac_accessible_description=The Macintosh Look & Feel
      LafMenu.mac_class=com.sun.java.swing.plaf.mac.MacLookAndFeel

      LafMenu.motif_label=Motif Look & Feel
      LafMenu.motif_mnemonic=O
      LafMenu.motif_accessible_description=The Motif Look & Feel
      LafMenu.motif_class=com.sun.java.swing.plaf.motif.MotifLookAndFeel

      LafMenu.windows_label=Windows Style Look & Feel
      LafMenu.windows_mnemonic=W
      LafMenu.windows_accessible_description=Windows Style Look & Feel
      LafMenu.windows_class=com.sun.java.swing.plaf.windows.WindowsLookAndFeel

      LafMenu.gtk_label=GTK Style Look & Feel
      LafMenu.gtk_mnemonic=0
      LafMenu.gtk_accessible_description=GTK Style Look & Feel
      LafMenu.gtk_class=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

      LafMenu.napkin_label=Napkin Style Look & Feel
      LafMenu.napkin_mnemonic=N
      LafMenu.napkin_accessible_description=Napkin Style Look & Feel
      LafMenu.napkin_class=napkin.NapkinLookAndFeel
      ---------- END SOURCE ----------
      (Review ID: 244269)
      ======================================================================

            shickeysunw Shannon Hickey (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: