8311585: Add JRadioButtonMenuItem to bug8031573.java
Reviewed-by: honkar, aivanov
This commit is contained in:
parent
2a11bc41ba
commit
4f90abaf17
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -32,18 +32,18 @@ import javax.swing.JCheckBoxMenuItem;
|
|||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuBar;
|
import javax.swing.JMenuBar;
|
||||||
import javax.swing.JMenuItem;
|
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JRadioButtonMenuItem;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.text.JTextComponent;
|
import javax.swing.text.JTextComponent;
|
||||||
|
|
||||||
/* @test
|
/* @test
|
||||||
* @bug 8031573 8040279 8143064
|
* @bug 8031573 8040279 8143064 8294427
|
||||||
* @summary [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered
|
* @summary Checkmarks of JCheckBoxMenuItems aren't rendered
|
||||||
* in high resolution on Retina
|
* in high resolution on Retina
|
||||||
|
* @requires (os.family != "linux")
|
||||||
* @run main/manual bug8031573
|
* @run main/manual bug8031573
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -54,14 +54,21 @@ public class bug8031573 {
|
|||||||
private static final CountDownLatch latch = new CountDownLatch(1);
|
private static final CountDownLatch latch = new CountDownLatch(1);
|
||||||
|
|
||||||
public static final String INSTRUCTIONS = "INSTRUCTIONS:\n\n"
|
public static final String INSTRUCTIONS = "INSTRUCTIONS:\n\n"
|
||||||
+ "Verify that high resolution system icons are used for JCheckBoxMenuItem on HiDPI displays.\n"
|
+ "Verify that the check and radio-check icons are rendered smoothly\n"
|
||||||
+ "If the display does not support HiDPI mode press PASS.\n"
|
+ "for both JCheckBoxMenuItem and JRadioButtonMenuItem.\n"
|
||||||
+ "1. Run the test on HiDPI Display.\n"
|
+ "1. Open the Menu.\n"
|
||||||
+ "2. Open the Menu.\n"
|
+ "2. Check that the icon on the JCheckBoxMenuItem is smooth.\n"
|
||||||
+ "3. Check that the icon on the JCheckBoxMenuItem is smooth.\n"
|
+ "3. Check that the icon on the JRadioButtonMenuItem is smooth.\n"
|
||||||
+ " If so, press PASS, else press FAIL.\n";
|
+ "4. If you're on Windows:\n"
|
||||||
|
+ " Test the markers are still crisp after changing the scale in Windows settings.\n"
|
||||||
|
+ " This could be done on same monitor by changing its scale or\n"
|
||||||
|
+ " by moving the window to a secondary monitor with a different scale.\n"
|
||||||
|
+ " Then go to step 6.\n"
|
||||||
|
+ "5. If you're on Mac OS:\n"
|
||||||
|
+ " If you tested on a Retina display, go to step 6.\n"
|
||||||
|
+ "6. If both icons render smoothly, press PASS, otherwise press FAIL.\n";
|
||||||
|
|
||||||
public static void main(String args[]) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
try {
|
try {
|
||||||
SwingUtilities.invokeAndWait(() -> createTestGUI());
|
SwingUtilities.invokeAndWait(() -> createTestGUI());
|
||||||
@ -88,6 +95,9 @@ public class bug8031573 {
|
|||||||
JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem("JCheckBoxMenuItem");
|
JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem("JCheckBoxMenuItem");
|
||||||
checkBoxMenuItem.setSelected(true);
|
checkBoxMenuItem.setSelected(true);
|
||||||
menu.add(checkBoxMenuItem);
|
menu.add(checkBoxMenuItem);
|
||||||
|
JRadioButtonMenuItem radioButtonMenuItem = new JRadioButtonMenuItem("JRadioButtonMenuItem");
|
||||||
|
radioButtonMenuItem.setSelected(true);
|
||||||
|
menu.add(radioButtonMenuItem);
|
||||||
bar.add(menu);
|
bar.add(menu);
|
||||||
frame.setJMenuBar(bar);
|
frame.setJMenuBar(bar);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user