21 * questions.
22 */
23
24 import sun.awt.SunToolkit;
25
26 import java.awt.Button;
27 import java.awt.CardLayout;
28 import java.awt.Font;
29 import java.awt.Frame;
30 import java.awt.Menu;
31 import java.awt.MenuBar;
32 import java.awt.Point;
33 import java.awt.Robot;
34 import java.awt.Toolkit;
35 import java.awt.event.ActionEvent;
36 import java.awt.event.ActionListener;
37 import java.awt.event.InputEvent;
38
39 /**
40 * @test
41 * @bug 6263470
42 * @summary Tries to change font of MenuBar. Test passes if the font has changed
43 * fails otherwise.
44 * @author Vyacheslav.Baranov: area=menu
45 * @run main MenuBarSetFont
46 */
47 public final class MenuBarSetFont {
48
49 private static final Frame frame = new Frame();
50 private static final MenuBar mb = new MenuBar();
51 private static volatile boolean clicked;
52
53 private static final class Listener implements ActionListener {
54 @Override
55 public void actionPerformed(final ActionEvent e) {
56 //Click on this button is performed
57 //_only_ if font of MenuBar is not changed on time
58 MenuBarSetFont.clicked = true;
59 }
60 }
|
21 * questions.
22 */
23
24 import sun.awt.SunToolkit;
25
26 import java.awt.Button;
27 import java.awt.CardLayout;
28 import java.awt.Font;
29 import java.awt.Frame;
30 import java.awt.Menu;
31 import java.awt.MenuBar;
32 import java.awt.Point;
33 import java.awt.Robot;
34 import java.awt.Toolkit;
35 import java.awt.event.ActionEvent;
36 import java.awt.event.ActionListener;
37 import java.awt.event.InputEvent;
38
39 /**
40 * @test
41 * @key headful
42 * @bug 6263470
43 * @summary Tries to change font of MenuBar. Test passes if the font has changed
44 * fails otherwise.
45 * @author Vyacheslav.Baranov: area=menu
46 * @run main MenuBarSetFont
47 */
48 public final class MenuBarSetFont {
49
50 private static final Frame frame = new Frame();
51 private static final MenuBar mb = new MenuBar();
52 private static volatile boolean clicked;
53
54 private static final class Listener implements ActionListener {
55 @Override
56 public void actionPerformed(final ActionEvent e) {
57 //Click on this button is performed
58 //_only_ if font of MenuBar is not changed on time
59 MenuBarSetFont.clicked = true;
60 }
61 }
|