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

JToolBar rollover mode doesn't work in Metal L&F

XMLWordPrintable



      Name: jl125535 Date: 08/03/2004


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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Setting rollover mode for JToolbar doesn't work under Metal L&F


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class RolloverBug
      {
       static void setLAF(String lafName)
       {
        try
          {
           UIManager.setLookAndFeel( lafName );

           Frame[] frames = Frame.getFrames();

           for( int i=0; i<frames.length; i++ )
             {
              SwingUtilities.updateComponentTreeUI( frames[i] );
             }
          }
        catch(Exception ex)
          {
           ex.printStackTrace();
          }
       }

       public static void main(String s[])
       {
        JFrame frame = new JFrame();

        JToolBar bar = new JToolBar(JToolBar.HORIZONTAL);

        bar.setRollover(true);

        UIManager.LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels();

        for( int i=0; i<lafs.length; i++ )
          {
           final String name = lafs[i].getName();
           final String className = lafs[i].getClassName();

           bar.add( new AbstractAction(name)
             {
              public void actionPerformed(ActionEvent evt) { setLAF(className); }
             });
          }

        frame.getContentPane().add(bar,BorderLayout.NORTH);

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.pack();

        frame.setVisible(true);
       }
      }

      ---------- END SOURCE ----------
      (Incident Review ID: 290414)
      ======================================================================

            Unassigned Unassigned
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: