super("MenuLayoutDemo");
menuBar = new JMenuBar();
menuBar.setLayout(new BoxLayout(menuBar, BoxLayout.Y_AXIS));
addNewMenu("Menu 1");
addNewMenu("Menu 2");
addNewMenu("Menu 3");
getContentPane().add(menuBar, BorderLayout.WEST);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});