From b5b6e0c1c725d2e44cd5a3d335ed064239ce362f Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Thu, 14 Mar 2024 16:00:43 -0700 Subject: [PATCH 1/5] init commit --- .../swing/JColorChooser/Test4887836.html | 32 --------------- .../swing/JColorChooser/Test4887836.java | 39 +++++++++++++------ 2 files changed, 28 insertions(+), 43 deletions(-) delete mode 100644 test/jdk/javax/swing/JColorChooser/Test4887836.html diff --git a/test/jdk/javax/swing/JColorChooser/Test4887836.html b/test/jdk/javax/swing/JColorChooser/Test4887836.html deleted file mode 100644 index 68192afdbcbc4..0000000000000 --- a/test/jdk/javax/swing/JColorChooser/Test4887836.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - -If you do not see white area under swatches, -then test passed, otherwise it failed. - - - - - diff --git a/test/jdk/javax/swing/JColorChooser/Test4887836.java b/test/jdk/javax/swing/JColorChooser/Test4887836.java index 9972b5fe08509..daf887d96b77e 100644 --- a/test/jdk/javax/swing/JColorChooser/Test4887836.java +++ b/test/jdk/javax/swing/JColorChooser/Test4887836.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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,23 +21,40 @@ * questions. */ +import java.awt.Color; +import java.awt.Font; +import javax.swing.JColorChooser; +import javax.swing.UIManager; + /* * @test * @bug 4887836 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame * @summary Checks if no tooltip modification when no KeyStroke modifier - * @author Konstantin Eremin - * @run applet/manual=yesno Test4887836.html + * @run main/manual Test4887836 */ +public class Test4887836 { + + public static void main(String[] args) throws Exception { + String instructions = "If you do not see white area under the \"Swatches\" tab,\n" + + "then test passed, otherwise it failed."; + + PassFailJFrame.builder() + .title("Test4759306") + .instructions(instructions) + .rows(5) + .columns(40) + .testTimeOut(10) + .splitUIRight(Test4887836::createColorChooser) + .build() + .awaitAndCheck(); + } -import java.awt.Color; -import java.awt.Font; -import javax.swing.JApplet; -import javax.swing.JColorChooser; -import javax.swing.UIManager; -public class Test4887836 extends JApplet { - public void init() { + private static JColorChooser createColorChooser() { + JColorChooser chooser = new JColorChooser(Color.LIGHT_GRAY); UIManager.put("Label.font", new Font("Perpetua", 0, 36)); // NON-NLS: property and font names - add(new JColorChooser(Color.LIGHT_GRAY)); + return chooser; } } From 9652def1adea7f45d78deccb63bb568d34527574 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Mon, 18 Mar 2024 12:54:35 -0700 Subject: [PATCH 2/5] remove middle copyright year, update spacings and jtreg summary --- test/jdk/javax/swing/JColorChooser/Test4887836.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/jdk/javax/swing/JColorChooser/Test4887836.java b/test/jdk/javax/swing/JColorChooser/Test4887836.java index daf887d96b77e..8f376007142a2 100644 --- a/test/jdk/javax/swing/JColorChooser/Test4887836.java +++ b/test/jdk/javax/swing/JColorChooser/Test4887836.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -31,9 +31,10 @@ * @bug 4887836 * @library /java/awt/regtesthelpers * @build PassFailJFrame - * @summary Checks if no tooltip modification when no KeyStroke modifier + * @summary Checks for white area under the JColorChooser Swatch tab * @run main/manual Test4887836 */ + public class Test4887836 { public static void main(String[] args) throws Exception { @@ -46,15 +47,16 @@ public static void main(String[] args) throws Exception { .rows(5) .columns(40) .testTimeOut(10) - .splitUIRight(Test4887836::createColorChooser) + .testUI(Test4887836::createColorChooser) .build() .awaitAndCheck(); } - private static JColorChooser createColorChooser() { JColorChooser chooser = new JColorChooser(Color.LIGHT_GRAY); - UIManager.put("Label.font", new Font("Perpetua", 0, 36)); // NON-NLS: property and font names + + // NON-NLS: property and font names + UIManager.put("Label.font", new Font("Perpetua", 0, 36)); return chooser; } } From 00bf78b217b5fa0a6cbad14c1add23ff4fb7b732 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Wed, 20 Mar 2024 10:58:28 -0700 Subject: [PATCH 3/5] text block instructions --- test/jdk/javax/swing/JColorChooser/Test4887836.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/swing/JColorChooser/Test4887836.java b/test/jdk/javax/swing/JColorChooser/Test4887836.java index 8f376007142a2..7b16d9e9ff101 100644 --- a/test/jdk/javax/swing/JColorChooser/Test4887836.java +++ b/test/jdk/javax/swing/JColorChooser/Test4887836.java @@ -38,8 +38,9 @@ public class Test4887836 { public static void main(String[] args) throws Exception { - String instructions = "If you do not see white area under the \"Swatches\" tab,\n" + - "then test passed, otherwise it failed."; + String instructions = """ + If you do not see white area under the \"Swatches\" tab,\n + + then test passed, otherwise it failed."""; PassFailJFrame.builder() .title("Test4759306") From 6ff8dfa40f21139ac656d334a6158c88901a142d Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Mon, 25 Mar 2024 09:45:37 -0700 Subject: [PATCH 4/5] change font --- test/jdk/javax/swing/JColorChooser/Test4887836.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/jdk/javax/swing/JColorChooser/Test4887836.java b/test/jdk/javax/swing/JColorChooser/Test4887836.java index 7b16d9e9ff101..ecb628ba4c807 100644 --- a/test/jdk/javax/swing/JColorChooser/Test4887836.java +++ b/test/jdk/javax/swing/JColorChooser/Test4887836.java @@ -56,8 +56,7 @@ public static void main(String[] args) throws Exception { private static JColorChooser createColorChooser() { JColorChooser chooser = new JColorChooser(Color.LIGHT_GRAY); - // NON-NLS: property and font names - UIManager.put("Label.font", new Font("Perpetua", 0, 36)); + UIManager.put("Label.font", new Font("Font.DIALOG", 0, 36)); return chooser; } } From 3b75b6adc7b56adee7af855da554457d3b9bc5c7 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Tue, 26 Mar 2024 13:43:43 -0700 Subject: [PATCH 5/5] instruction string change --- test/jdk/javax/swing/JColorChooser/Test4887836.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/javax/swing/JColorChooser/Test4887836.java b/test/jdk/javax/swing/JColorChooser/Test4887836.java index ecb628ba4c807..4043dbdd88ae6 100644 --- a/test/jdk/javax/swing/JColorChooser/Test4887836.java +++ b/test/jdk/javax/swing/JColorChooser/Test4887836.java @@ -39,7 +39,7 @@ public class Test4887836 { public static void main(String[] args) throws Exception { String instructions = """ - If you do not see white area under the \"Swatches\" tab,\n + + If you do not see white area under the \"Swatches\" tab, then test passed, otherwise it failed."""; PassFailJFrame.builder()