Skip to content

Commit d86b78b

Browse files
author
duke
committed
Backport cc5b9c63cbc1743e22f80dce51d803e267c60317
1 parent 7b2a675 commit d86b78b

File tree

2 files changed

+32
-45
lines changed

2 files changed

+32
-45
lines changed

test/jdk/javax/swing/JColorChooser/Test4887836.html

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

test/jdk/javax/swing/JColorChooser/Test4887836.java

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 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,23 +21,42 @@
2121
* questions.
2222
*/
2323

24+
import java.awt.Color;
25+
import java.awt.Font;
26+
import javax.swing.JColorChooser;
27+
import javax.swing.UIManager;
28+
2429
/*
2530
* @test
2631
* @bug 4887836
27-
* @summary Checks if no tooltip modification when no KeyStroke modifier
28-
* @author Konstantin Eremin
29-
* @run applet/manual=yesno Test4887836.html
32+
* @library /java/awt/regtesthelpers
33+
* @build PassFailJFrame
34+
* @summary Checks for white area under the JColorChooser Swatch tab
35+
* @run main/manual Test4887836
3036
*/
3137

32-
import java.awt.Color;
33-
import java.awt.Font;
34-
import javax.swing.JApplet;
35-
import javax.swing.JColorChooser;
36-
import javax.swing.UIManager;
38+
public class Test4887836 {
39+
40+
public static void main(String[] args) throws Exception {
41+
String instructions = """
42+
If you do not see white area under the \"Swatches\" tab,
43+
then test passed, otherwise it failed.""";
44+
45+
PassFailJFrame.builder()
46+
.title("Test4759306")
47+
.instructions(instructions)
48+
.rows(5)
49+
.columns(40)
50+
.testTimeOut(10)
51+
.testUI(Test4887836::createColorChooser)
52+
.build()
53+
.awaitAndCheck();
54+
}
55+
56+
private static JColorChooser createColorChooser() {
57+
JColorChooser chooser = new JColorChooser(Color.LIGHT_GRAY);
3758

38-
public class Test4887836 extends JApplet {
39-
public void init() {
40-
UIManager.put("Label.font", new Font("Perpetua", 0, 36)); // NON-NLS: property and font names
41-
add(new JColorChooser(Color.LIGHT_GRAY));
59+
UIManager.put("Label.font", new Font("Font.DIALOG", 0, 36));
60+
return chooser;
4261
}
4362
}

0 commit comments

Comments
 (0)