1
1
/*
2
- * Copyright (c) 2009, 2017 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2009, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
21
21
* questions.
22
22
*/
23
23
24
- /* @test
25
- @bug 6726866 8186617
26
- @summary Repainting artifacts when resizing or dragging JInternalFrames in
24
+ /*
25
+ * @test
26
+ * @bug 6726866 8186617
27
+ * @summary Repainting artifacts when resizing or dragging JInternalFrames in
27
28
non-opaque toplevel
28
- @run applet/manual=yesno bug6726866.html
29
+ * @library /java/awt/regtesthelpers
30
+ * @build PassFailJFrame
31
+ * @run main/manual bug6726866
29
32
*/
30
33
31
34
import java .awt .Color ;
36
39
import javax .swing .JFrame ;
37
40
import javax .swing .JInternalFrame ;
38
41
import javax .swing .JLabel ;
42
+ import javax .swing .SwingUtilities ;
43
+
44
+ public class bug6726866 {
39
45
40
- public class bug6726866 extends JApplet {
46
+ private static final String INSTRUCTIONS = """
47
+ Drag the internal frame inside the green undecorated window,
48
+ if you can drag it the test passes, otherwise fails. """ ;
49
+
50
+ public static void main (String [] args ) throws Exception {
51
+ PassFailJFrame .builder ()
52
+ .title ("JInternalFrame Instructions" )
53
+ .instructions (INSTRUCTIONS )
54
+ .rows (5 )
55
+ .columns (35 )
56
+ .testUI (bug6726866 ::createUI )
57
+ .build ()
58
+ .awaitAndCheck ();
59
+ }
41
60
42
- public void init () {
61
+ private static JFrame createUI () {
43
62
JFrame frame = new JFrame ("bug6726866" );
44
63
frame .setUndecorated (true );
45
64
setWindowNonOpaque (frame );
@@ -53,10 +72,8 @@ public void init() {
53
72
desktop .add (iFrame );
54
73
frame .add (desktop );
55
74
56
- frame .setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
57
75
frame .setSize (400 , 400 );
58
- frame .setVisible (true );
59
- frame .toFront ();
76
+ return frame ;
60
77
}
61
78
62
79
public static void setWindowNonOpaque (Window window ) {
0 commit comments