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 6299858 7124338
27 @summary PIT. Focused border not shown on List if selected item is removed, XToolkit
28 @author Dmitry.Cherepanov@SUN.COM area=awt.list
29 @run applet FirstItemRemoveTest.html
30 */
31
32 import java.applet.Applet;
33 import java.awt.*;
34 import java.awt.event.*;
35
36 public class FirstItemRemoveTest extends Applet
37 {
38 List list = new List(4, false);
39 Panel panel = new Panel();
40
41 public void init()
42 {
43 list.add("000");
44 list.add("111");
45 list.add("222");
46 list.add("333");
47 list.add("444");
48 list.add("555");
49
50 panel.setLayout(new FlowLayout ());
51 panel.add(list);
52
53 this.add(panel);
54 this.setLayout (new FlowLayout ());
55 }//End init()
56
57 public void start ()
58 {
59 setSize (200,200);
60 setVisible(true);
61 validate();
62
63 test();
64 }// start()
65
66 private void test(){
67
68 if (jdk.testlibrary.OSInfo.getOSType() == jdk.testlibrary.OSInfo.OSType.MACOSX) {
69 System.err.println("Skipped. This test is not for OS X.");
70 return;
71 }
72
73 Robot r;
74 try {
75 r = new Robot();
76 } catch(AWTException e) {
77 throw new RuntimeException(e.getMessage());
78 }
79
80 // Removing first item in order to reproduce incorrect behaviour
81 r.delay(1000);
82 list.remove(0);
83 r.delay(1000);
84
85 // Request focus to list
86 Point loc = this.getLocationOnScreen();
87 r.delay(1000);
88
|
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 6299858 7124338
27 @summary PIT. Focused border not shown on List if selected item is removed, XToolkit
28 @author Dmitry.Cherepanov@SUN.COM area=awt.list
29 @run applet FirstItemRemoveTest.html
30 */
31
32 import jdk.test.lib.Platform;
33
34 import java.applet.Applet;
35 import java.awt.*;
36 import java.awt.event.*;
37
38 public class FirstItemRemoveTest extends Applet
39 {
40 List list = new List(4, false);
41 Panel panel = new Panel();
42
43 public void init()
44 {
45 list.add("000");
46 list.add("111");
47 list.add("222");
48 list.add("333");
49 list.add("444");
50 list.add("555");
51
52 panel.setLayout(new FlowLayout ());
53 panel.add(list);
54
55 this.add(panel);
56 this.setLayout (new FlowLayout ());
57 }//End init()
58
59 public void start ()
60 {
61 setSize (200,200);
62 setVisible(true);
63 validate();
64
65 test();
66 }// start()
67
68 private void test(){
69
70 if (Platform.isOSX()) {
71 System.err.println("Skipped. This test is not for OS X.");
72 return;
73 }
74
75 Robot r;
76 try {
77 r = new Robot();
78 } catch(AWTException e) {
79 throw new RuntimeException(e.getMessage());
80 }
81
82 // Removing first item in order to reproduce incorrect behaviour
83 r.delay(1000);
84 list.remove(0);
85 r.delay(1000);
86
87 // Request focus to list
88 Point loc = this.getLocationOnScreen();
89 r.delay(1000);
90
|