Sure, it's pretty much just a JFrame with a JMenuBar.
public class GUI implements ActionListener {
private JFrame frame;
private JMenuItem exit;
public GUI() {
/* Initialise the JFrame */
frame = new JFrame("JC Chat");
frame.setSize(300,440);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setJMenuBar(createMenuBar());
// createComponents();
} /* End constructor */
public JMenuBar createMenuBar() {
/* Create the Frame MenuBar */
JMenuBar menu = new JMenuBar();
JMenu file = new JMenu("File");
JMenu edit = new JMenu("Edit");
exit = new JMenuItem("Exit");
exit.setMnemonic('E');
exit.addActionListener(this);
file.add(exit);
menu.add(file);
menu.add(edit);
return menu;
}
Message was edited by:
juco