|
1 | 1 | /* |
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. |
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 javax.swing.JColorChooser; |
| 25 | +import javax.swing.JPanel; |
| 26 | + |
24 | 27 | /* |
25 | 28 | * @test |
26 | 29 | * @bug 4759306 |
| 30 | + * @library /java/awt/regtesthelpers |
| 31 | + * @build PassFailJFrame |
27 | 32 | * @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 |
30 | 34 | */ |
| 35 | +public class Test4759306 { |
31 | 36 |
|
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 | + } |
35 | 48 |
|
36 | | -public class Test4759306 extends JApplet { |
37 | | - public void init() { |
| 49 | + private static JColorChooser createColorChooser() { |
38 | 50 | JColorChooser chooser = new JColorChooser(); |
39 | 51 | chooser.setPreviewPanel(new JPanel()); |
40 | | - getContentPane().add(chooser); |
| 52 | + return chooser; |
41 | 53 | } |
42 | 54 | } |
0 commit comments