-
Bug
-
Resolution: Cannot Reproduce
-
P5
-
None
-
1.1.7
-
x86
-
windows_nt
Name: clC74495 Date: 10/26/98
This is from Oracle, a Java licensee.
The Oracle bug number is 753016.
This bug did occur with JDK 1.1.7, but didn't occur with JDK1.1.6.
Please consider this a regression problem, and examine it ASAP.
From JDK1.1.7, if user tries to active an inactive window, it gets repainted
which is not necessary. Another minor problem also happened here. If the
user clicks on a menu in an inactive window, the menuitem does not appear.
To reproduce:
1. Start the following test case;
2. Click on the inactive window, you will see the flash which is the
repainting happened.
3. Click on the menu in the inactive frame, the menuitems don't appear.
You need to click on the menu again in order to bring up the menuitems.
Test case:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class b518877
extends Applet
{
private Frame _mFrame1;
private Frame _mFrame2;
public b518877()
{
}
public void start()
{
_mFrame1 = new TestFrame("Frame 1");
_mFrame2 = new TestFrame("Frame 2");
_mFrame1.setBounds(100, 100, 300, 200);
_mFrame2.setBounds(125, 125, 300, 200);
_mFrame1.validate();
_mFrame2.validate();
_mFrame1.setVisible(true);
_mFrame2.setVisible(true);
}
}
class TestFrame extends Frame
implements WindowListener
{
private TextField _mField1;
private TextField _mField2;
private MenuBar _mMenuBar;
private Menu _mMenu;
TestFrame(String name)
{
super(name);
_mField1 = new TextField();
_mField2 = new TextField();
add(_mField1, "East");
add(_mField2, "West");
add(new PopupMenu("dummy"));
addWindowListener(this);
}
public void windowOpened(WindowEvent e)
{
}
public void windowClosing(WindowEvent e)
{
}
public void windowClosed(WindowEvent e)
{
}
public void windowIconified(WindowEvent e)
{
}
public void windowDeiconified(WindowEvent e)
{
}
public void windowActivated(WindowEvent e)
{
_mMenuBar = new MenuBar();
_mMenu = new Menu("Menu 01");
_mMenu.add(new MenuItem("Item 01"));
_mMenu.add(new MenuItem("Item 02"));
_mMenu.add(new MenuItem("Item 03"));
_mMenu.add(new MenuItem("Item 04"));
_mMenu.add(new MenuItem("Item 05"));
_mMenu.add(new MenuItem("Item 06"));
_mMenu.add(new MenuItem("Item 07"));
_mMenu.add(new MenuItem("Item 08"));
_mMenu.add(new MenuItem("Item 09"));
_mMenu.add(new MenuItem("Item 10"));
_mMenuBar.add(_mMenu);
_mMenu = new Menu("Menu 02");
_mMenu.add(new MenuItem("Item 01"));
_mMenu.add(new MenuItem("Item 02"));
_mMenu.add(new MenuItem("Item 03"));
_mMenu.add(new MenuItem("Item 04"));
_mMenu.add(new MenuItem("Item 05"));
_mMenu.add(new MenuItem("Item 06"));
_mMenu.add(new MenuItem("Item 07"));
_mMenu.add(new MenuItem("Item 08"));
_mMenu.add(new MenuItem("Item 09"));
_mMenu.add(new MenuItem("Item 10"));
_mMenuBar.add(_mMenu);
_mMenu = new Menu("Menu 03");
_mMenu.add(new MenuItem("Item 01"));
_mMenu.add(new MenuItem("Item 02"));
_mMenu.add(new MenuItem("Item 03"));
_mMenu.add(new MenuItem("Item 04"));
_mMenu.add(new MenuItem("Item 05"));
_mMenu.add(new MenuItem("Item 06"));
_mMenu.add(new MenuItem("Item 07"));
_mMenu.add(new MenuItem("Item 08"));
_mMenu.add(new MenuItem("Item 09"));
_mMenu.add(new MenuItem("Item 10"));
_mMenuBar.add(_mMenu);
_mMenu = new Menu("Menu 04");
_mMenu.add(new MenuItem("Item 01"));
_mMenu.add(new MenuItem("Item 02"));
_mMenu.add(new MenuItem("Item 03"));
_mMenu.add(new MenuItem("Item 04"));
_mMenu.add(new MenuItem("Item 05"));
_mMenu.add(new MenuItem("Item 06"));
_mMenu.add(new MenuItem("Item 07"));
_mMenu.add(new MenuItem("Item 08"));
_mMenu.add(new MenuItem("Item 09"));
_mMenu.add(new MenuItem("Item 10"));
_mMenuBar.add(_mMenu);
_mMenu = new Menu("Menu 05");
_mMenu.add(new MenuItem("Item 01"));
_mMenu.add(new MenuItem("Item 02"));
_mMenu.add(new MenuItem("Item 03"));
_mMenu.add(new MenuItem("Item 04"));
_mMenu.add(new MenuItem("Item 05"));
_mMenu.add(new MenuItem("Item 06"));
_mMenu.add(new MenuItem("Item 07"));
_mMenu.add(new MenuItem("Item 08"));
_mMenu.add(new MenuItem("Item 09"));
_mMenu.add(new MenuItem("Item 10"));
_mMenuBar.add(_mMenu);
setMenuBar(_mMenuBar);
}
public void windowDeactivated(WindowEvent e)
{
}
}
(Review ID: 41150)
======================================================================