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

REGRESSION: MetalLookAndFeel.setCurrentTheme ignored

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b62
    • CPU:
      sparc
    • OS:
      solaris_9

      Description

      Name: gm110360 Date: 07/12/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
      Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      SunOS mary 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Blade-100

      A DESCRIPTION OF THE PROBLEM :
      Invocation to MetalLookAndFeel.setCurrentTheme has no effect.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the program below

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The program should print
      javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=bold,size=40]
      and show a button with a bigger font.
      ACTUAL -
      Nothing is printed; the font size of the button is normal

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import javax.swing.plaf.*;
      import javax.swing.plaf.metal.*;

      class Swing {
          public static void main(String[] args) {
              MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
                  private final FontUIResource ctf = new FontUIResource(super.getControlTextFont().deriveFont(40.0f));
                  public FontUIResource getControlTextFont() { System.out.println(ctf); return ctf; }
              });
              JFrame frame = new JFrame();
              frame.setSize(400, 400);
              frame.getContentPane().add(new JButton("Cancel"));
              frame.setVisible(true);
          }
      }

      ---------- END SOURCE ----------

      Release Regression From : 1.4.2
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Incident Review ID: 285593)
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            svioletsunw Scott Violet (Inactive)
            Reporter:
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: