-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
x86
-
windows_2000
Name: rmT116609 Date: 07/19/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
(1.) Run the following program on Windows.
(2.) When your mouse is on the menu of the first internal frame,
the rollover effect covers a part of the second internal frame
even it has the focus. It is very ugly ans unacceptable !
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
/**
* This is a JDK1.4 bug
*
* Suppose you have a JInternalFrame in a JDesktopPane.
* Add a JMenuBar with a JMenu to this internal frame.
* Add any internal component (like an other internal frame) to the
* desktop.
* Run the application and drag the internal component on the internal frame
* until it covers the half of menu.
* Now, when the mouse is on the menu, the rollover effect
* paints the menu on the component, masking a part of it, instead of
* beeing masked itself.
*/
public class MenuBug extends JFrame {
JDesktopPane desktop;
static int openFrameCount = 0;
static final int xOffset = 30, yOffset = 30;
public MenuBug() {
super("JMenuBar of JInternalFrame bug");
desktop = new JDesktopPane();
getContentPane().add(desktop, BorderLayout.CENTER);
setBounds(0,0,700,500);
setVisible(true);
}
public void createInternalFrame() {
JInternalFrame jif = new JInternalFrame("Bug", true,true,true,true);
jif.addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameClosing(InternalFrameEvent e) {
openFrameCount--;
}
});
jif.setJMenuBar(createMenuBar());
openFrameCount++;
desktop.add(jif);
jif.setBounds(xOffset*openFrameCount, yOffset*openFrameCount,400,300);
jif.setVisible(true);
}
private JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar();
menuBar.add(new JMenu("Bugged display"));
return(menuBar);
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception ex) {
System.out.println(ex);
}
MenuBug mb = new MenuBug();
mb.createInternalFrame();
mb.createInternalFrame();
}
}
My os is Win2K Pro sp1. This bug can be reproduced only on Win98SE, Win2K and WinMe due
to the implementation of the WindowsMenuUI class in jdk1.4. It tests if the version of Windows
"is classic" (i.e. os.version property <= 4 : see : WindowsLookAndFeel class).
If it's true the super paintBackground and paintText methods are called, otherwise the rollover effect
is painted. So, this bug can be seen only if the os is Win98SE, Win2K or WinMe.
(Review ID: 128328)
======================================================================