//
protected JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar();
JMenuItem mi;
JMenu file = (JMenu) menuBar.add(new JMenu("File"));
file.setMnemonic('F');
openItem = (JMenuItem) file.add(new JMenuItem("Open..."));
openItem.setMnemonic('O');
openItem.addActionListener(new OpenItemListener());
closeItem = (JMenuItem) file.add(new JMenuItem("Close"));
closeItem.setMnemonic('C');
closeItem.addActionListener(new CloseItemListener());
file.addSeparator();
loadItem = (JMenuItem) file.add(new JMenuItem("Load..."));
loadItem.setMnemonic('L');
loadItem.addActionListener(new LoadItemListener());
saveItem = (JMenuItem) file.add(new JMenuItem("Save As..."));
saveItem.setMnemonic('S');
saveItem.addActionListener(new SaveItemListener());
file.addSeparator();
mi = (JMenuItem) file.add(new JMenuItem("Exit"));
mi.setMnemonic('x');
mi.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
JMenu control = (JMenu) menuBar.add(new JMenu("Control"));
file.setMnemonic('C');
playItem = (JMenuItem) control.add(new JMenuItem("Play"));
playItem.setMnemonic('P');
playItem.addActionListener(new PlayItemListener());
stopItem = (JMenuItem) control.add(new JMenuItem("Stop"));
stopItem.setMnemonic('S');
stopItem.addActionListener(new StopItemListener());
control.addSeparator();
queryItem = (JMenuItem) control.add(new JMenuItem("Query"));
queryItem.setMnemonic('Q');
queryItem.addActionListener(new QueryItemListener());
JMenu options = (JMenu) menuBar.add(new JMenu("Options"));
file.setMnemonic('O');
showItem = (JCheckBoxMenuItem) options.add(
new JCheckBoxMenuItem("Show Visual"));
showItem.setMnemonic('S');
showItem.addActionListener(new ShowItemListener());
setFileMenuState(numberOfTracks);