Package java.awt

Examples of java.awt.MenuBar


        fMain.setIconImage(imgEmpty);
        fMain.addWindowListener(this);
        fMain.setSize(640, 480);
        fMain.add("Center", this);

        MenuBar  bar    = new MenuBar();
        String[] extras = {
            "Insert 10 rows only", "Insert 1000 rows only", "Insert all rows",
            "-", "Load Settings...", "Save Settings...", "-", "Exit"
        };
        Menu menu = new Menu("Options");

        addMenuItems(menu, extras);
        bar.add(menu);
        fMain.setMenuBar(bar);
        initGUI();

        Dimension d    = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension size = fMain.getSize();
View Full Code Here


        q.init();
        q.start();
        fMain.add("Center", q);

        MenuBar menu = new MenuBar();
        Menu    file = new Menu("File");

        file.add("Exit");
        file.addActionListener(q);
        menu.add(file);
        fMain.setMenuBar(menu);
        fMain.setSize(500, 400);
        fMain.show();
        fMain.addWindowListener(q);
    }
View Full Code Here

        fMain.setIconImage(imgEmpty);
        fMain.addWindowListener(this);
        fMain.setSize(640, 480);
        fMain.add("Center", this);

        MenuBar  bar    = new MenuBar();
        String[] extras = {
            "Insert 10 rows only", "Insert 1000 rows only", "Insert all rows",
            "-", "Load Settings...", "Save Settings...", "-", "Exit"
        };
        Menu menu = new Menu("Options");

        addMenuItems(menu, extras);
        bar.add(menu);
        fMain.setMenuBar(bar);
        initGUI();

        Dimension d    = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension size = fMain.getSize();
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

     * @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

        setLayout (new java.awt.BorderLayout ());

        drawCanvas_ = new BrushSizeDrawCanvas(controller_, 400,400);
        add(drawCanvas_, BorderLayout.CENTER);

        menuBar1 = new MenuBar ();
        menu1 = new Menu ();
        menu1.setLabel ("Menu");
        select = new MenuItem ();
        select.setLabel ("Select");
        select.setName ("select");
View Full Code Here

        fMain.setIconImage(imgEmpty);
        fMain.addWindowListener(this);
        fMain.setSize(640, 480);
        fMain.add("Center", this);

        MenuBar  bar    = new MenuBar();
        String[] extras = {
            "Insert 10 rows only", "Insert 1000 rows only", "Insert all rows",
            "-", "Load Settings...", "Save Settings...", "-", "Exit"
        };
        Menu menu = new Menu("Options");

        addMenuItems(menu, extras);
        bar.add(menu);
        fMain.setMenuBar(bar);
        initGUI();

        Dimension d    = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension size = fMain.getSize();
View Full Code Here

        q.init();
        q.start();
        fMain.add("Center", q);

        MenuBar menu = new MenuBar();
        Menu    file = new Menu("File");

        file.add("Exit");
        file.addActionListener(q);
        menu.add(file);
        fMain.setMenuBar(menu);
        fMain.setSize(500, 400);
        fMain.show();
        fMain.addWindowListener(q);
    }
View Full Code Here

    super.initialize(type, oldInstance, newInstance, enc);
    if (type != oldInstance.getClass()) {
            return;
        }
   
    MenuBar bar = (MenuBar) oldInstance;
    int count = bar.getMenuCount();
    Expression getterExp = null;
    for (int i = 0; i < count; i++) {
      getterExp = new Expression(bar.getMenu(i), "getLabel", null);
      try {
        // Calculate the old value of the property
        Object oldVal = getterExp.getValue();
        // Write the getter expression to the encoder
        enc.writeExpression(getterExp);
        // Get the target value that exists in the new environment
        Object targetVal = enc.get(oldVal);
        // Get the current property value in the new environment
        Object newVal = null;
        try {
          newVal = new Expression(((MenuBar) newInstance).getMenu(i),
              "getLabel", null).getValue();
        } catch (IndexOutOfBoundsException ex) {
          // The newInstance has no elements, so current property
          // value remains null
        }
        /*
         * Make the target value and current property value equivalent
         * in the new environment
         */
        if (null == targetVal) {
          if (null != newVal) {
            // Set to null
            Statement setterStm = new Statement(oldInstance, "insert",
                new Object[] { null, i });
            enc.writeStatement(setterStm);
          }
        } else {
          PersistenceDelegate pd = enc
              .getPersistenceDelegate(targetVal.getClass());
          if (!pd.mutatesTo(targetVal, newVal)) {
            Menu menu = new Menu((String) oldVal);
            menu.setName(bar.getMenu(i).getName());
            Statement setterStm = new Statement(oldInstance,
                "add", new Object[] { menu });
            enc.writeStatement(setterStm);
          }
        }
View Full Code Here

    private void addMenuBar(boolean supportStyledText,
                            boolean supportPlainText,
                            int[] menus) {
       
        MenuBar menuBar = new MenuBar();
        String menuTitle = ResourceUtils.getString(EditorResources.FILE);
        Menu menu = new Menu(menuTitle);
        new AwtFileMenuManager(menu, fApplication, this,
                                supportStyledText, supportPlainText);
        menuBar.add(menu);

        AwtMenuBuilder.getInstance().createMenus(menuBar, fTextPanel, this, menus);
        setMenuBar(menuBar);
    }
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.