Skip to content

Commit fab0edc

Browse files
author
Alisen Chung
committedMar 14, 2024
8328121: Remove applet usage from JColorChooser tests Test4759306
Reviewed-by: azvegint
1 parent 7c6fd33 commit fab0edc

File tree

2 files changed

+21
-40
lines changed

2 files changed

+21
-40
lines changed
 

‎test/jdk/javax/swing/JColorChooser/Test4759306.html

-31
This file was deleted.

‎test/jdk/javax/swing/JColorChooser/Test4759306.java

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2008, 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,22 +21,34 @@
2121
* questions.
2222
*/
2323

24+
import javax.swing.JColorChooser;
25+
import javax.swing.JPanel;
26+
2427
/*
2528
* @test
2629
* @bug 4759306
30+
* @library /java/awt/regtesthelpers
31+
* @build PassFailJFrame
2732
* @summary Checks if JColorChooser.setPreviewPanel removes the old one
28-
* @author Konstantin Eremin
29-
@run applet/manual=yesno Test4759306.html
33+
* @run main/manual Test4759306
3034
*/
35+
public class Test4759306 {
3136

32-
import javax.swing.JApplet;
33-
import javax.swing.JColorChooser;
34-
import javax.swing.JPanel;
37+
public static void main(String[] args) throws Exception {
38+
PassFailJFrame.builder()
39+
.title("Test4759306")
40+
.instructions("Check that there is no panel titled \"Preview\" in the JColorChooser.")
41+
.rows(5)
42+
.columns(40)
43+
.testTimeOut(10)
44+
.splitUIRight(Test4759306::createColorChooser)
45+
.build()
46+
.awaitAndCheck();
47+
}
3548

36-
public class Test4759306 extends JApplet {
37-
public void init() {
49+
private static JColorChooser createColorChooser() {
3850
JColorChooser chooser = new JColorChooser();
3951
chooser.setPreviewPanel(new JPanel());
40-
getContentPane().add(chooser);
52+
return chooser;
4153
}
4254
}

0 commit comments

Comments
 (0)
Please sign in to comment.