< prev index next >

test/jdk/java/awt/List/FocusEmptyListTest/FocusEmptyListTest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2007, 2015, 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. --- 1,7 ---- /* ! * Copyright (c) 2007, 2018, 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.
*** 20,48 **** * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! test @bug 6387275 @summary List: the focus is at the top of the first item, XAWT ! @author Dmitry.Cherepanov@SUN.COM area=awt.list ! @run applet FocusEmptyListTest.html */ - import java.applet.Applet; import java.awt.*; import java.lang.reflect.*; import java.awt.peer.ListPeer; import sun.awt.AWTAccessor; ! public class FocusEmptyListTest extends Applet { ! public void init() { ! setLayout(new BorderLayout()); ! }//End init() public void start() { boolean isXToolkit = Toolkit.getDefaultToolkit() .getClass().getName().equals("sun.awt.X11.XToolkit"); if (!isXToolkit) { --- 20,52 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! @test ! @key headful @bug 6387275 @summary List: the focus is at the top of the first item, XAWT ! @requires (os.family == "linux" | os.family == "solaris") ! @modules java.desktop/sun.awt ! java.desktop/java.awt.peer ! java.desktop/sun.awt.X11:open ! @run main FocusEmptyListTest */ import java.awt.*; import java.lang.reflect.*; import java.awt.peer.ListPeer; import sun.awt.AWTAccessor; ! public class FocusEmptyListTest extends Frame { ! public static void main(final String[] args) { ! FocusEmptyListTest app = new FocusEmptyListTest(); ! app.start(); ! } public void start() { boolean isXToolkit = Toolkit.getDefaultToolkit() .getClass().getName().equals("sun.awt.X11.XToolkit"); if (!isXToolkit) {
*** 59,68 **** --- 63,74 ---- add(list); list.add("item1"); setSize(200, 200); + setUndecorated(true); + setLocationRelativeTo(null); setVisible(true); validate(); list.removeAll();
< prev index next >