9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 test
26 @bug 5044150
27 @summary Tests that pupup doesn't popdown if no space to display under
28 @author andrei.dmitriev area=awt.choice
29 @library ../../../../lib/testlibrary
30 @build jdk.testlibrary.OSInfo
31 @run applet PopupPosTest.html
32 */
33
34 import java.applet.Applet;
35 import java.awt.*;
36 import java.awt.event.*;
37
38 import jdk.testlibrary.OSInfo;
39
40 public class PopupPosTest extends Applet
41 {
42 public void start ()
43 {
44 if(OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) {
45 // On OS X, popup isn't under the mouse
46 return;
47 }
48 Frame frame = new TestFrame();
49 }
50 }
51
52 class TestFrame extends Frame implements ItemListener {
53 Robot robot;
54 Toolkit tk = Toolkit.getDefaultToolkit();
55 Choice choice = new Choice();
56 boolean indexChanged = false;
57 final static int INITIAL_ITEM = 99;
58 volatile boolean stateChanged;
59
60 public TestFrame() {
61 for (int i = 0; i < 100; i++) {
62 choice.addItem("Item Item Item " + i);
63 }
64 choice.addItemListener(this);
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 test
26 @bug 5044150
27 @summary Tests that pupup doesn't popdown if no space to display under
28 @author andrei.dmitriev area=awt.choice
29 @library /test/lib
30 @build jdk.test.lib.Platform
31 @run applet PopupPosTest.html
32 */
33
34 import java.applet.Applet;
35 import java.awt.*;
36 import java.awt.event.*;
37
38 import jdk.test.lib.Platform;
39
40 public class PopupPosTest extends Applet
41 {
42 public void start ()
43 {
44 if (Platform.isOSX()) {
45 // On OS X, popup isn't under the mouse
46 return;
47 }
48 Frame frame = new TestFrame();
49 }
50 }
51
52 class TestFrame extends Frame implements ItemListener {
53 Robot robot;
54 Toolkit tk = Toolkit.getDefaultToolkit();
55 Choice choice = new Choice();
56 boolean indexChanged = false;
57 final static int INITIAL_ITEM = 99;
58 volatile boolean stateChanged;
59
60 public TestFrame() {
61 for (int i = 0; i < 100; i++) {
62 choice.addItem("Item Item Item " + i);
63 }
64 choice.addItemListener(this);
|