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 import java.awt.Robot;
25 import java.awt.Toolkit;
26 import java.awt.event.KeyEvent;
27 import javax.swing.JFileChooser;
28 import javax.swing.SwingUtilities;
29 import javax.swing.UIManager;
30 import javax.swing.UIManager.LookAndFeelInfo;
31 import sun.awt.SunToolkit;
32
33 /**
34 * @test
35 * @bug 8002077
36 * @author Alexander Scherbatiy
37 * @summary Possible mnemonic issue on JFileChooser Save button on nimbus L&F
38 * @library ../../regtesthelpers/
39 * @build Util
40 * @run main bug8002077
41 */
42 public class bug8002077 {
43
44 private static volatile int fileChooserState = JFileChooser.ERROR_OPTION;
45
46 public static void main(String[] args) throws Exception {
47 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
48 if ("Nimbus".equals(info.getName())) {
49 UIManager.setLookAndFeel(info.getClassName());
50 UIManager.put("FileChooser.openButtonMnemonic", KeyEvent.VK_O);
51 UIManager.put("FileChooser.saveButtonMnemonic", KeyEvent.VK_S);
52 runTest();
53 break;
54 }
|
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 import java.awt.Robot;
25 import java.awt.Toolkit;
26 import java.awt.event.KeyEvent;
27 import javax.swing.JFileChooser;
28 import javax.swing.SwingUtilities;
29 import javax.swing.UIManager;
30 import javax.swing.UIManager.LookAndFeelInfo;
31 import sun.awt.SunToolkit;
32
33 /**
34 * @test
35 * @key headful
36 * @bug 8002077
37 * @author Alexander Scherbatiy
38 * @summary Possible mnemonic issue on JFileChooser Save button on nimbus L&F
39 * @library ../../regtesthelpers/
40 * @build Util
41 * @run main bug8002077
42 */
43 public class bug8002077 {
44
45 private static volatile int fileChooserState = JFileChooser.ERROR_OPTION;
46
47 public static void main(String[] args) throws Exception {
48 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
49 if ("Nimbus".equals(info.getName())) {
50 UIManager.setLookAndFeel(info.getClassName());
51 UIManager.put("FileChooser.openButtonMnemonic", KeyEvent.VK_O);
52 UIManager.put("FileChooser.saveButtonMnemonic", KeyEvent.VK_S);
53 runTest();
54 break;
55 }
|