8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @bug 4449413
26 * @summary Tests that checkbox and radiobuttons' check marks are visible when background is black
27 * @author Ilya Boyandin
28 * @library ../../../../lib/testlibrary
29 * @modules java.desktop/sun.awt
30 * @build jdk.testlibrary.OSInfo
31 * @run applet/manual=yesno bug4449413.html
32 */
33
34 import javax.swing.*;
35 import javax.swing.plaf.metal.*;
36 import java.awt.event.*;
37 import java.awt.*;
38 import jdk.testlibrary.OSInfo;
39
40 public class bug4449413 extends JApplet {
41
42 @Override
43 public void init() {
44
45 try {
46
47 if (OSInfo.getOSType() == OSInfo.OSType.MACOSX) {
48 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
49 }
50
51 final MetalTheme oceanTheme = (MetalTheme) sun.awt.AppContext.getAppContext().get("currentMetalTheme");
52
53
54 SwingUtilities.invokeAndWait(new Runnable() {
55
56 @Override
57 public void run() {
58 getContentPane().setLayout(new FlowLayout());
59 final JPanel panel = new JPanel();
60
61 JCheckBox box = new JCheckBox("Use Ocean theme", true);
62 getContentPane().add(box);
63 box.addItemListener(new ItemListener() {
64
65 @Override
66 public void itemStateChanged(ItemEvent e) {
67 if (e.getStateChange() == ItemEvent.SELECTED) {
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /* @test
25 * @bug 4449413
26 * @summary Tests that checkbox and radiobuttons' check marks are visible when background is black
27 * @author Ilya Boyandin
28 * @library /test/lib
29 * @modules java.desktop/sun.awt
30 * @build jdk.test.lib.Platform
31 * @run applet/manual=yesno bug4449413.html
32 */
33
34 import javax.swing.*;
35 import javax.swing.plaf.metal.*;
36 import java.awt.event.*;
37 import java.awt.*;
38
39 import jdk.test.lib.Platform;
40
41 public class bug4449413 extends JApplet {
42
43 @Override
44 public void init() {
45
46 try {
47
48 if (Platform.isOSX()) {
49 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
50 }
51
52 final MetalTheme oceanTheme = (MetalTheme) sun.awt.AppContext.getAppContext().get("currentMetalTheme");
53
54
55 SwingUtilities.invokeAndWait(new Runnable() {
56
57 @Override
58 public void run() {
59 getContentPane().setLayout(new FlowLayout());
60 final JPanel panel = new JPanel();
61
62 JCheckBox box = new JCheckBox("Use Ocean theme", true);
63 getContentPane().add(box);
64 box.addItemListener(new ItemListener() {
65
66 @Override
67 public void itemStateChanged(ItemEvent e) {
68 if (e.getStateChange() == ItemEvent.SELECTED) {
|