/Users/lyon/j4p/src/ip/gui/frames/BeanFrameTester.java

1    package ip.gui.frames; 
2     
3    import gui.BeanShortCutFrame; 
4     
5    import java.awt.*; 
6     
7     
8    public class BeanFrameTester extends BeanShortCutFrame { 
9     
10       public static void main(String args[]) { 
11           BeanFrameTester bt = new BeanFrameTester("BeanTester"); 
12       } 
13    
14       public BeanFrameTester(String title) { 
15           super(title); 
16           initMenuBar(); 
17           setSize(300, 300); 
18           show(); 
19       } 
20    
21       public void item1() { 
22           System.out.println("item1"); 
23       } 
24    
25       public void item2() { 
26           System.out.println("item2"); 
27       } 
28    
29       public void itemH1() { 
30           System.out.println("itemH1"); 
31       } 
32    
33       public void itemH2() { 
34           System.out.println("itemH2"); 
35       } 
36    
37       public void initMenuBar() { 
38           Menu m1 = new Menu("Event Menu"); 
39    
40           addMenuItem(m1, "[E-T-1]item1", "item1"); 
41           addMenuItem(m1, "[T-1]item2", "item2"); 
42    
43           Menu hierarchicMenu = new Menu("Hierarchic Menu"); 
44           addMenuItem(hierarchicMenu, "[E-h]itemH1", "itemH1"); 
45           addMenuItem(hierarchicMenu, "[h]itemH2", "itemH2"); 
46    
47           MenuBar mb = new MenuBar(); 
48           m1.add(hierarchicMenu); 
49           mb.add(m1); 
50           setMenuBar(mb); 
51       } 
52    
53       public void paint(Graphics g) { 
54           g.drawString("bean tester", 150, 150); 
55       } 
56    
57   } 
58    
59