addItem(help, "Getting started");
addItem(help, "About");
}
-
+ /**
+ * Creats a menu in the menubar.
+ * @param name The name of the menu.
+ * @param mnemnic The shortcut-key to access the menu.
+ * @return menu The menu created.
+ */
private JMenu createMenu(String name, int mnemonic) {
JMenu menu = new JMenu(name);
menu.setMnemonic(mnemonic);
return menu;
}
+ /**
+ * Creats a menuitem in the menu.
+ * @param menu The menu where to add the menuitem.
+ * @param name The name of the menuitem.
+ * @return item The menuitem created.
+ */
private JMenuItem addItem(JMenu menu, String name) {
JMenuItem item = new JMenuItem(name);
item.addActionListener(this);
return item;
}
+ /**
+ * Creats a menuitem in the menu.
+ * @param menu The menu to where to add the menuitem.
+ * @param name The name of the menuitem.
+ * @param key The keystroke to access this menuitem.
+ * @return item The menuitem created.
+ */
private JMenuItem addItem(JMenu menu, String name, String key) {
JMenuItem item = new JMenuItem(name);
item.setAccelerator(KeyStroke.getKeyStroke(key));
return item;
}
+ /**
+ * Creats a menuitem in the menu.
+ * @param menu The menu to where to add the menuitem.
+ * @param name The name of the menuitem.
+ * @param key The keystroke to access this menuitem.
+ * @param mask The keyboard mask.
+ * @return item The menuitem created.
+ */
private JMenuItem addItem(JMenu menu, String name, int key, int mask) {
JMenuItem item = new JMenuItem(name);
item.setAccelerator(KeyStroke.getKeyStroke(key, mask));
}
return false;
}
-
+ /**
+ * Gets the users command of takes and properiate action
+ * @param e the action perfomed
+ */
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
Sequence seq;
} else if (command == "Transpose...") {
} else if (command == "Contents") {
- // contents to be filled in
+
JOptionPane.showMessageDialog(this, "här kommer contents komma");
} else if (command == "Getting started") {
- // getting started to be filled in
+
JOptionPane.showMessageDialog(null, "här kommer getting started komma");
} else if (command == "About") {
- // about to be filled in
+
JOptionPane.showMessageDialog(null, "här kommer about att komma");
}
}