test/javax/swing/plaf/windows/WindowsRootPaneUI/WrongAltProcessing/WrongAltProcessing.java
Print this page
@@ -20,11 +20,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
- @bug 8001633
+ @bug 8001633 8028271
@summary Wrong alt processing during switching between windows
@author mikhail.cherkasov@oracle.com
@run main WrongAltProcessing
*/
@@ -74,11 +74,11 @@
robot.setAutoDelay(100);
}
private static void clickWindowsTitle(JFrame frame) {
Point point = frame.getLocationOnScreen();
- robot.mouseMove(point.x + (frame.getWidth() / 2), point.y + 5);
+ robot.mouseMove(point.x + (frame.getWidth() / 2), point.y + 10);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
public static void runScript() {
@@ -110,10 +110,11 @@
}
public static void createWindows() {
firstFrame = new JFrame("Frame");
firstFrame.setLayout(new FlowLayout());
+ firstFrame.setPreferredSize(new Dimension(600,100));
JMenuBar bar = new JMenuBar();
JMenu menu = new JMenu("File");
JMenuItem item = new JMenuItem("Save");
@@ -144,10 +145,11 @@
firstFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
firstFrame.pack();
secondFrame = new JFrame("Frame 2");
+ secondFrame.setPreferredSize(new Dimension(600,100));
secondFrame.setLocation(0, 150);
secondFrameTf = new JTextField(20);
secondFrame.add(secondFrameTf);
secondFrame.pack();
SwingUtilities.invokeLater(new Runnable() {