Package java.awt

Examples of java.awt.MenuBar


        if (comp instanceof SwingBaseWindow) {
            SwingBaseWindow<?, ?> base = (SwingBaseWindow<?, ?>) comp;
            if (base.isShowing()) {
                Window w = base.getAWTComponent();
                if (w instanceof Frame) {
                    MenuBar mb = ((Frame) w).getMenuBar();
                    if (mb != null) {
                        JMenuBar jmb = ((SwingMenuBarPeer) mb.getPeer()).jComponent;
                        Point p = new Point(x, y);
                        SwingUtilities.convertPointFromScreen(p, jmb);
                        comp = SwingUtilities.getDeepestComponentAt(jmb, p.x, p.y);
                        if (comp != null && (comp != jmb || jmb.contains(p.x, p.y))) {
                            return comp;
View Full Code Here


    public SwingJFramePeer(SwingToolkit toolkit, Frame target) {
        super(toolkit, target, new SwingJFrame(target));
        setResizable(target.isResizable());
        setState(target.getState());
        peerComponent.setTitle(target.getTitle());
        MenuBar mb = target.getMenuBar();
        if (mb != null) {
            setMenuBar(mb);
        }
    }
View Full Code Here

            //ignore
        }
        setState(target.getState());
        peerComponent.setTitle(target.getTitle());
        // frame.setIconImage(awtFrame.getIconImage());
        MenuBar mb = target.getMenuBar();
        if (mb != null) {
            setMenuBar(mb);
        }

        addToDesktop();
View Full Code Here

                2));

        fMain.setIconImage(imgEmpty);
        fMain.addWindowListener(this);

        MenuBar bar = new MenuBar();

        // used shortcuts: CERGTSIUDOLM
        String[] fitems = {
            "-Connect...", "--", "-Open Script...", "-Save Script...",
            "-Save Result...", "-Save Result csv...", "--", "-Exit"
        };

        addMenu(bar, "File", fitems);

        String[] vitems = {
            "RRefresh Tree", "--", "GResults in Grid", "TResults in Text",
            "--", "1Shrink Tree", "2Enlarge Tree", "3Shrink Command",
            "4Enlarge Command"
        };

        addMenu(bar, "View", vitems);

        String[] sitems = {
            "SSELECT", "IINSERT", "UUPDATE", "DDELETE", "--", "-CREATE TABLE",
            "-DROP TABLE", "-CREATE INDEX", "-DROP INDEX", "--", "-CHECKPOINT",
            "-SCRIPT", "-SET", "-SHUTDOWN", "--", "-Test Script"
        };

        addMenu(bar, "Command", sitems);

        Menu recent = new Menu("Recent");

        mRecent = new Menu("Recent");

        bar.add(mRecent);

        String[] soptions = {
            "-AutoCommit on", "-AutoCommit off", "OCommit", "LRollback", "--",
            "-Disable MaxRows", "-Set MaxRows to 100", "--", "-Logging on",
            "-Logging off", "--", "-Insert test data"
View Full Code Here

    //create the MenuBar Object
   
   
   
    menuListen = new myMenuListener();
    myMenu = new MenuBar();
    MenuItem item = null;

    //create the top level button

    Menu File = new Menu("File");
View Full Code Here

     * @return java.awt.MenuBar
     */
    private MenuBar getAntMakeMenuBar() {
        if (iAntMakeMenuBar == null) {
            try {
                iAntMakeMenuBar = new MenuBar();
                iAntMakeMenuBar.add(getFileMenu());
                iAntMakeMenuBar.add(getHelpMenu());
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

     * @return java.awt.MenuBar
     */
    private MenuBar getAntMakeMenuBar() {
        if (iAntMakeMenuBar == null) {
            try {
                iAntMakeMenuBar = new MenuBar();
                iAntMakeMenuBar.add(getFileMenu());
                iAntMakeMenuBar.add(getHelpMenu());
            } catch (Throwable iExc) {
                handleException(iExc);
            }
View Full Code Here

    /**
     * @param title
     */
    public AWTMenuTest(String title) {
        super(title);
        MenuBar mb = new MenuBar();
        mb.add(new Menu("Window"));
        setMenuBar(mb);
    }
View Full Code Here

            buttons.addElement(b);
            windows.put(b, w);
        }

        MainWindow() {
            MenuBar mb = new MenuBar();
            Menu menu = new Menu("File");
            Menu submenu = new Menu("Testing", true);
            submenu.add(new CheckboxMenuItem("FooBar"));
            submenu.add(new CheckboxMenuItem("BarFoo"));
            menu.add(submenu);
            menu.add(new MenuItem("Orange"));
            MenuItem quit = new MenuItem("Quit", new MenuShortcut('Q'));
            quit.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    System.exit(0);
                }
            });
            menu.add(quit);
            mb.add(menu);

            menu = new Menu("Edit", true);
            menu.add(new MenuItem("Cut"));
            menu.add(new MenuItem("Copy"));
            menu.add(new MenuItem("Paste"));
            mb.add(menu);

            Menu helpMenu = new Menu("Help");
            helpMenu.add(new MenuItem("About"));
            mb.add(helpMenu);
            mb.setHelpMenu(helpMenu);

            setMenuBar(mb);

            String version = System.getProperty("gnu.classpath.version");
            add(new Label("GNU Classpath " + version), "North");
View Full Code Here

                f2.toFront();
            }
        });
        //f.add(front);

        MenuBar mb = new MenuBar();
        Menu window = new Menu("Window");
        mb.add(window);
        MenuItem show_mi = new MenuItem("show");
        show_mi.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                f2.setVisible(true);
            }
View Full Code Here

TOP

Related Classes of java.awt.MenuBar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.