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

the menu is twinkling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1 P1
    • None
    • 1.4.0
    • client-libs

      Compile and run following codes:

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class TestJDK extends JFrame {
          int i = 0;
          public TestJDK() {
              setTitle("Frame");
      JMenuBar mBar = new JMenuBar();
              JMenu menu = new JMenu("menu1");
              JMenuItem item = new JMenuItem("menuitem1");
              menu.add(item);
      menu.add(new JMenuItem("menuitem2"));
              mBar.add(menu);

              menu = new JMenu("menu2");
      menu.add(new JMenuItem("menuitem1"));
      menu.add(new JMenuItem("menuitem2"));
      mBar.add(menu);

      menu = new JMenu("menu3");
      menu.add(new JMenuItem("menuitem1"));
              menu.add(new JMenuItem("menuitem2"));
      mBar.add(menu);

      this.setJMenuBar(mBar);
              
      this.getContentPane().setLayout(new BorderLayout());
              pack();
              setSize(500,400);
              setVisible(true);
          }
          
          public static void main(String[] args) {
              new TestJDK();
          }
      }

      you will find under jdk1.2, every thing is ok, but under jdk1.4, when we browse menus, there are always some twinkling, it seems the whole frame is refreshed when move menus.

            svioletsunw Scott Violet (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: