FileDocCategorySizeDatePackage
MenuGlueDemo.javaAPI DocExample963Tue Dec 12 18:59:18 GMT 2000None

MenuGlueDemo

public class MenuGlueDemo extends JFrame
author
ges
author
kwalrath

Fields Summary
protected JMenuBar
menuBar
Constructors Summary
public MenuGlueDemo()

        super("MenuGlueDemo");
        menuBar = new JMenuBar();
        setJMenuBar(menuBar);
        addNewMenu("Menu 1");
        addNewMenu("Menu 2");
        menuBar.add(Box.createHorizontalGlue());
        addNewMenu("Menu 3");

        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
    
Methods Summary
public voidaddNewMenu(java.lang.String title)

        JMenu m = (JMenu)menuBar.add(new JMenu(title));
        m.add("Menu item");
        m.add("Menu item");
        m.add("Menu item");
    
public static voidmain(java.lang.String[] args)

        MenuGlueDemo f = new MenuGlueDemo();
        f.setSize(300, 50);
        f.setVisible(true);