/* * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
This bug occurs in jdk <= 1.1.6, 1.2b3. The problem is that key press and release events will not be delivered to a choice component with the focus if the mouse is over another component (of any type);
This bug occurs in Motif and was fixed in the native code.
1. Set the focus on choice component 1 by selecting an item. 2. Move the mouse over choice component 2, BUT do not set the focus on it. 3. Type some characters e.g. 'a', 'b' etc. 4. Verify by the console output that all the key events are delivered to choice component 1, not 2. If all the key events are delivered to choice 1, the test passes.
*/
//transfer focus to Choice
Util.waitForIdle(robot);
Util.clickOnComp(c1, robot);
Util.waitForIdle(robot);
//close choice
Util.clickOnComp(c1, robot);
//position a mouse over a different component
Point pt = c2.getLocationOnScreen();
robot.mouseMove(pt.x + c2.getWidth()/2, pt.y + c2.getHeight()/2);
Util.waitForIdle(robot);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.