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

Inconsistent rollover effects in Ocean theme

    XMLWordPrintable

    Details

      Description

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      In the Ocean theme, JButtons display a rollover effect by showing an additional line border. But JToggleButtons do not, nor does the default button in a dialog. The user may think that the button is disabled because there is no rollover effect.

      Please provide rollover feedback for all enabled buttons.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See source code.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expect rollover effects on all enabled buttons.
      ACTUAL -
      No rollover effects for toggle buttons and the default button.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.FlowLayout;

      import javax.swing.JFrame;
      import javax.swing.JButton;
      import javax.swing.JToggleButton;

      public class TestRollover {

          public static void main(String[] args) {
              JFrame f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.getContentPane().setLayout(new FlowLayout());
              f.getContentPane().add(new JButton("JButton - Rollover"));
              f.getContentPane().add(new JToggleButton("JToggleButton - No Rollover"));
              JButton defaultButton = new JButton("Default Button - No Rollover");
              f.getContentPane().add(defaultButton);
      System.out.println( defaultButton.isRolloverEnabled() );
              f.getRootPane().setDefaultButton(defaultButton);
              f.pack();
              f.setLocationRelativeTo(null);
              f.setVisible(true);
          }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Haven't tried it yet, but one could install custom borders which implement the rollover effect. Might have to copy code from MetalBorders.java, and a lot of classes (e.g., MetalUtils) aren't visible so it's far from straightforward.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: