1 package hero.client.manager; 2 3 24 25 import java.awt.event.ActionEvent ; 26 import java.awt.event.ActionListener ; 27 import java.awt.Color ; 28 29 import javax.swing.ImageIcon ; 30 import javax.swing.JMenu ; 31 import javax.swing.JMenuBar ; 32 import javax.swing.JMenuItem ; 33 34 public class Menubar extends JMenuBar { 35 36 static java.util.ResourceBundle resource = java.util.ResourceBundle.getBundle("resources.Traduction"); 37 38 public Menubar(final Manager m) { 39 ClassLoader cl = m.getClass().getClassLoader(); 40 41 JMenu menu; 42 JMenuItem mi; 43 44 menu = new JMenu (resource.getString("menubar.manager")); 45 menu.setBackground(new Color (153, 153, 255)); 46 add(menu); 47 48 mi = new JMenuItem (new ImageIcon (cl.getResource("images/new.png"))); 50 mi.setText(resource.getString("menubar.newproj")); 51 mi.setBackground(new Color (153, 153, 255)); 52 mi.addActionListener (new ActionListener () { 53 public void actionPerformed (ActionEvent e) { 54 m.NewProject(); 55 } 56 }); 57 menu.add(mi); 58 59 mi = new JMenuItem (new ImageIcon (cl.getResource("images/Copy.gif"))); 61 mi.setText(resource.getString("menubar.cloneproj")); 62 mi.setBackground(new Color (153, 153, 255)); 63 mi.addActionListener (new ActionListener () { 64 public void actionPerformed (ActionEvent e) { 65 m.CloneProject(); 66 } 67 }); 68 menu.add(mi); 69 70 mi = new JMenuItem (new ImageIcon (cl.getResource("images/Copy.gif"))); 72 mi.setText(resource.getString("menubar.instproj")); 73 mi.setBackground(new Color (153, 153, 255)); 74 mi.addActionListener (new ActionListener () { 75 public void actionPerformed (ActionEvent e) { 76 m.InstantiateProject(); 77 } 78 }); 79 menu.add(mi); 80 81 menu.addSeparator(); 82 83 mi = new JMenuItem (resource.getString("menubar.exit")); 84 mi.setIcon(new ImageIcon (cl.getResource("images/exit.png"))); 85 mi.setBackground(new Color (153, 153, 255)); 86 mi.addActionListener (new ActionListener () { 87 public void actionPerformed (ActionEvent e) { 88 try { 89 System.exit(0); 92 }catch(Exception ex){} 93 } 94 }); 95 menu.add(mi); 96 } 97 } 98 | Popular Tags |