|
1 | 1 | /* |
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. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
21 | 21 | * questions. |
22 | 22 | */ |
23 | 23 |
|
| 24 | +import java.awt.Color; |
| 25 | +import java.awt.Font; |
| 26 | +import javax.swing.JColorChooser; |
| 27 | +import javax.swing.UIManager; |
| 28 | + |
24 | 29 | /* |
25 | 30 | * @test |
26 | 31 | * @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 |
30 | 36 | */ |
31 | 37 |
|
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); |
37 | 58 |
|
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; |
42 | 61 | } |
43 | 62 | } |
0 commit comments