Package java.awt

Examples of java.awt.MenuBar


*/
public class AWTMenuBuilderTest {
    public static void main(String[] argv) {
        final List<Menu> menuList = new ArrayList<Menu>();
        final Frame f = new Frame("AWT Menu Builder Test");
        final MenuBar mb = new MenuBar();
        f.setMenuBar(mb);

        Menu m = new Menu("Menu " + (menuList.size() + 1));
        menuList.add(m);
        mb.add(m);

        Button addMenu = new Button("Add menu");
        addMenu.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                Menu m = new Menu("Menu " + (menuList.size() + 1));
                menuList.add(m);
                mb.add(m);
            }
        });
        final PopupMenu popup = new PopupMenu("Popup");
        f.add(popup);
        f.addMouseListener(new MouseAdapter() {
View Full Code Here


   List c5 = new List();
   harness.check(c5.getName(), "list3");
   harness.check(c4.getName(), "list4");
   harness.check(c3.getName(), "list5");
  
   MenuBar d0 = new MenuBar();
   MenuBar d1 = new MenuBar();
   MenuBar d2 = new MenuBar();
   harness.check(d0.getName(), "menubar0");
   harness.check(d1.getName(), "menubar1");
   harness.check(d2.getName(), "menubar2");
   MenuBar d3 = new MenuBar();
   MenuBar d4 = new MenuBar();
   MenuBar d5 = new MenuBar();
   harness.check(d5.getName(), "menubar3");
   harness.check(d4.getName(), "menubar4");
   harness.check(d3.getName(), "menubar5");
  
   MenuItem e0 = new MenuItem();
   MenuItem e1 = new MenuItem();
View Full Code Here

 
  public void testPR28699(TestHarness harness)
  {
    harness.checkPoint("PR29699");
    Frame f = new Frame("AWT Menu Test");
    MenuBar mb = new MenuBar();
    Menu m = new Menu("Menu 1");
    mb.add(m);
    f.setMenuBar(mb);
    f.add(new Button("Button"));
    f.pack();
    MenuItem itemA = new MenuItem("Item A");
    m.insert(itemA, 0);
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

  /* Finds all the top level menus from the menu bar and
     recurses down through each. */

  public void findAllMenuItems() {
    MenuBar menuBar = Menus.getMenuBar();
    int topLevelMenus = menuBar.getMenuCount();
    for (int i=0; i<topLevelMenus; ++i) {
      Menu topLevelMenu=menuBar.getMenu(i);
      parseMenu(topLevelMenu.getLabel(), topLevelMenu);
    }
  }
View Full Code Here

        continue;
      }
      String labelText = strings.get(stringIndex);
      items[i] = new MenuItem(labelText);
    }
    menuBar = new MenuBar();
    // FILE - SAVE AS
    Menu fileSaveAsMenu = createMenu(strings, StringIndexConstants.SAVEAS);
    items[MenuIndexConstants.FILE_SAVEAS] = fileSaveAsMenu;
    fileSaveAsMenu.add(items[MenuIndexConstants.FILE_SAVEAS_GIF]);
    fileSaveAsMenu.add(items[MenuIndexConstants.FILE_SAVEAS_PALM]);
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

                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

                2));

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

        MenuBar bar = new MenuBar();

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

        addMenu(bar, "File", fitems);

        String[] vitems = {
            "-Refresh Tree", "--", "-View Tree", "-View Command",
            "-View Result", "-View Editor", "--", "-Results in Grid",
            "-Results in Text"
        };

        addMenu(bar, "View", vitems);

        String[] sitems = {
            "-SELECT", "-INSERT", "-UPDATE", "-DELETE", "--", "-CREATE TABLE",
            "-DROP TABLE", "-CREATE INDEX", "-DROP INDEX", "--", "-SCRIPT",
            "-SHUTDOWN", "--", "-Test Script"
        };

        addMenu(bar, "SQL", sitems);

        Menu recent = new Menu("Recent");

        mRecent = new Menu("Recent");

        bar.add(mRecent);

        String[] soptions = {
            "-AutoCommit on", "-AutoCommit off", "-Commit", "-Rollback", "--",
            "-Disable MaxRows", "-Set MaxRows to 100", "--", "-Logging on",
            "-Logging off", "--",
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.