11/*
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.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2121 * questions.
2222 */
2323
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
2728 non-opaque toplevel
28- @run applet/manual=yesno bug6726866.html
29+ * @library /java/awt/regtesthelpers
30+ * @build PassFailJFrame
31+ * @run main/manual bug6726866
2932*/
3033
3134import java .awt .Color ;
3639import javax .swing .JFrame ;
3740import javax .swing .JInternalFrame ;
3841import javax .swing .JLabel ;
42+ import javax .swing .SwingUtilities ;
43+
44+ public class bug6726866 {
3945
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+ }
4160
42- public void init () {
61+ private static JFrame createUI () {
4362 JFrame frame = new JFrame ("bug6726866" );
4463 frame .setUndecorated (true );
4564 setWindowNonOpaque (frame );
@@ -53,10 +72,8 @@ public void init() {
5372 desktop .add (iFrame );
5473 frame .add (desktop );
5574
56- frame .setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
5775 frame .setSize (400 , 400 );
58- frame .setVisible (true );
59- frame .toFront ();
76+ return frame ;
6077 }
6178
6279 public static void setWindowNonOpaque (Window window ) {
0 commit comments