-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b85
-
generic
-
generic
A DESCRIPTION OF THE REGRESSION :
Menu parts overlapping heavyweight components being partially outside the main window don't properly react to mouse gestures.
REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
// store code in Menu.java, compile and run
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Menu
{
public JMenuBar createMenuBar()
{
ActionListener l = new ActionListener()
{
public void actionPerformed(ActionEvent e)
{ System.out.println("Ouch!"); }
};
JMenuBar b = new JMenuBar();
JMenu m = new JMenu("A Menu");
b.add(m);
JMenuItem i = new JMenuItem("A menu item",KeyEvent.VK_A);
m.add(i);
i.addActionListener(l);
m = new JMenu("Another Menu");
b.add(m);
i = new JMenuItem("Yet another menu item",KeyEvent.VK_Y);
m.add(i);
i.addActionListener(l);
return b;
}
private static void createAndShowGUI()
{
JFrame frame = new JFrame("Menu");
Menu m = new Menu();
frame.setJMenuBar(m.createMenuBar());
frame.setSize(200, 200);
frame.setVisible(true);
}
public static void main(String[] args)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{ public void run() { createAndShowGUI(); }});
}
}
RELEASE LAST WORKED:
5.0 Update 6
RELEASE TEST FAILS:
mustang-b70
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
- Compile and run the code below on Java 5 Update 6, a window with two menus opens.
- Klick "Another Menu", and move the pointer, keeping the left mouse button still pressed, onto the menu's
single item, "Yet another menu item".
- The highlight jumps from "Another Menu" to "Yet another menu item". This is correct.
- Release the mouse button (pointer still over "Yet another menu item").
- The menu closes and the handler is called (printing "Ouch!" to the shell). As expected.
- Move the pointer over "A Menu" (all buttons still released).
- Nothing happens. That's fine.
ACTUAL -
- Run the code below on Mustang build 70, a window with two menus opens.
- Klick "Another Menu", and move the pointer, keeping the left mouse button still pressed, onto the menu's
single item, "Yet another menu item".
- "Another Menu" is still highlighted., the menu item "Yet another menu item" doesn't get the highlight: just wrong.
- Release the mouse button (pointer still over "Yet another menu item").
- Nothing happens. Weird.
- Move the pointer over "A Menu" (all buttons still released).
- The menu pops down. Not as expected.
Menu parts overlapping heavyweight components being partially outside the main window don't properly react to mouse gestures.
REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
// store code in Menu.java, compile and run
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Menu
{
public JMenuBar createMenuBar()
{
ActionListener l = new ActionListener()
{
public void actionPerformed(ActionEvent e)
{ System.out.println("Ouch!"); }
};
JMenuBar b = new JMenuBar();
JMenu m = new JMenu("A Menu");
b.add(m);
JMenuItem i = new JMenuItem("A menu item",KeyEvent.VK_A);
m.add(i);
i.addActionListener(l);
m = new JMenu("Another Menu");
b.add(m);
i = new JMenuItem("Yet another menu item",KeyEvent.VK_Y);
m.add(i);
i.addActionListener(l);
return b;
}
private static void createAndShowGUI()
{
JFrame frame = new JFrame("Menu");
Menu m = new Menu();
frame.setJMenuBar(m.createMenuBar());
frame.setSize(200, 200);
frame.setVisible(true);
}
public static void main(String[] args)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{ public void run() { createAndShowGUI(); }});
}
}
RELEASE LAST WORKED:
5.0 Update 6
RELEASE TEST FAILS:
mustang-b70
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
- Compile and run the code below on Java 5 Update 6, a window with two menus opens.
- Klick "Another Menu", and move the pointer, keeping the left mouse button still pressed, onto the menu's
single item, "Yet another menu item".
- The highlight jumps from "Another Menu" to "Yet another menu item". This is correct.
- Release the mouse button (pointer still over "Yet another menu item").
- The menu closes and the handler is called (printing "Ouch!" to the shell). As expected.
- Move the pointer over "A Menu" (all buttons still released).
- Nothing happens. That's fine.
ACTUAL -
- Run the code below on Mustang build 70, a window with two menus opens.
- Klick "Another Menu", and move the pointer, keeping the left mouse button still pressed, onto the menu's
single item, "Yet another menu item".
- "Another Menu" is still highlighted., the menu item "Yet another menu item" doesn't get the highlight: just wrong.
- Release the mouse button (pointer still over "Yet another menu item").
- Nothing happens. Weird.
- Move the pointer over "A Menu" (all buttons still released).
- The menu pops down. Not as expected.