Skip to content

Commit cfd9209

Browse files
committed
8327751: Convert javax/swing/JInternalFrame/6726866/bug6726866.java applet test to main
Reviewed-by: aivanov
1 parent 2cf3524 commit cfd9209

File tree

2 files changed

+27
-40
lines changed

2 files changed

+27
-40
lines changed

test/jdk/javax/swing/JInternalFrame/6726866/bug6726866.html

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/jdk/javax/swing/JInternalFrame/6726866/bug6726866.java

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
@@ -21,11 +21,14 @@
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

3134
import java.awt.Color;
@@ -36,10 +39,26 @@
3639
import javax.swing.JFrame;
3740
import javax.swing.JInternalFrame;
3841
import 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

Comments
 (0)