From fab0edc9e636c69d7012e476e97661ddae993a03 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Thu, 14 Mar 2024 22:53:32 +0000 Subject: [PATCH] 8328121: Remove applet usage from JColorChooser tests Test4759306 Reviewed-by: azvegint --- .../swing/JColorChooser/Test4759306.html | 31 --------------- .../swing/JColorChooser/Test4759306.java | 38 ++++++++++++------- 2 files changed, 25 insertions(+), 44 deletions(-) delete mode 100644 test/jdk/javax/swing/JColorChooser/Test4759306.html diff --git a/test/jdk/javax/swing/JColorChooser/Test4759306.html b/test/jdk/javax/swing/JColorChooser/Test4759306.html deleted file mode 100644 index 6e3bfed203f..00000000000 --- a/test/jdk/javax/swing/JColorChooser/Test4759306.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - -If you see the preview panel, then test failed, otherwise it passed. - - - - - diff --git a/test/jdk/javax/swing/JColorChooser/Test4759306.java b/test/jdk/javax/swing/JColorChooser/Test4759306.java index 37a549acd79..762031ec481 100644 --- a/test/jdk/javax/swing/JColorChooser/Test4759306.java +++ b/test/jdk/javax/swing/JColorChooser/Test4759306.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2008, 2024 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,22 +21,34 @@ * questions. */ -/* - * @test - * @bug 4759306 - * @summary Checks if JColorChooser.setPreviewPanel removes the old one - * @author Konstantin Eremin - @run applet/manual=yesno Test4759306.html - */ - -import javax.swing.JApplet; import javax.swing.JColorChooser; import javax.swing.JPanel; -public class Test4759306 extends JApplet { - public void init() { +/* + * @test + * @bug 4759306 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Checks if JColorChooser.setPreviewPanel removes the old one + * @run main/manual Test4759306 + */ +public class Test4759306 { + + public static void main(String[] args) throws Exception { + PassFailJFrame.builder() + .title("Test4759306") + .instructions("Check that there is no panel titled \"Preview\" in the JColorChooser.") + .rows(5) + .columns(40) + .testTimeOut(10) + .splitUIRight(Test4759306::createColorChooser) + .build() + .awaitAndCheck(); + } + + private static JColorChooser createColorChooser() { JColorChooser chooser = new JColorChooser(); chooser.setPreviewPanel(new JPanel()); - getContentPane().add(chooser); + return chooser; } }