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