01: /*
02: * Jacareto Copyright (c) 2002-2005
03: * Applied Computer Science Research Group, Darmstadt University of
04: * Technology, Institute of Mathematics & Computer Science,
05: * Ludwigsburg University of Education, and Computer Based
06: * Learning Research Group, Aachen University. All rights reserved.
07: *
08: * Jacareto is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public
10: * License as published by the Free Software Foundation; either
11: * version 2 of the License, or (at your option) any later version.
12: *
13: * Jacareto is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public
19: * License along with Jacareto; if not, write to the Free
20: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21: *
22: */
23:
24: package jacareto.trial;
25:
26: import java.awt.event.KeyEvent;
27:
28: import javax.swing.KeyStroke;
29:
30: /**
31: * Tests the class <code>javax.swing.Keystroke</code>.
32: *
33: * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
34: * @version 1.0
35: */
36: public class KeyStrokeTest {
37: /**
38: * The main method.
39: *
40: * @param args the command line arguments
41: */
42: public static void main(String[] args) {
43: KeyStroke stroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0);
44: KeyStroke stroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_F1,
45: KeyEvent.VK_SHIFT);
46: KeyStroke stroke3 = KeyStroke.getKeyStroke("F1");
47: KeyStroke stroke4 = KeyStroke.getKeyStroke("control C");
48:
49: System.out.println(stroke1 + ";" + stroke1.getKeyCode() + ";"
50: + stroke1.getModifiers());
51: System.out.println(stroke2 + ";" + stroke2.getKeyCode() + ";"
52: + stroke2.getModifiers());
53: System.out.println(stroke3 + ";" + stroke3.getKeyCode() + ";"
54: + stroke3.getModifiers());
55: System.out.println(stroke4 + ";" + stroke4.getKeyCode() + ";"
56: + stroke4.getModifiers());
57: }
58: }
|