-
Bug
-
Resolution: Duplicate
-
P1
-
None
-
1.4.0
-
sparc
-
solaris_8
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.
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.
- duplicates
-
JDK-4419252 Expose events being incorrectly generated
- Resolved