Package javax.swing

Examples of javax.swing.JMenuBar


    setBounds(inset, inset, screenSize.width - inset * 2, screenSize.height - inset * 2);
  }

  protected JMenuBar createMenuBar()
  {
    final JMenuBar menuBar = new JMenuBar();

//Set up the lone menu.
    final JMenu menu = new JMenu("Document");
    menu.setMnemonic(KeyEvent.VK_D);
    menuBar.add(menu);

    menu.add(new ActionMenuItem(new NewFrameAction()));
    menu.add(new ActionMenuItem(getPreviewAction()));
    menu.addSeparator();
    menu.add(new ActionMenuItem(getCloseAction()));
View Full Code Here


            }
        }

        if (showMenu) {
            JMenu editMenu = createMenu();
            JMenuBar mb = ComponentFactory.getMenuBar();
            mb.add(editMenu);
           
            mb.setMinimumSize(new Dimension(100, 23));
            mb.setPreferredSize(new Dimension(100, 23));
           
            add(mb, Layout.getGBC(0, 0, 1, 1, 10.0, 10.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                     new Insets( 0, 0, 0, 0), 0, 0));
        }
View Full Code Here

   * @see javax.swing.JComponent#getDefaultLocale
   */
  public Accelerators()
      throws HeadlessException
  {
    JMenuBar menuBar = new JMenuBar();
    final JMenu c = new JMenu("Fha");
    c.add(new ActionMenuItem (new MyAction()));
    c.add(new ActionMenuItem (new MyAction()));
    menuBar.add(c);

    setJMenuBar(menuBar);
  }
View Full Code Here

   *
   * @return the menu bar.
   */
  protected JMenuBar createMenuBar()
  {
    final JMenuBar mb = new JMenuBar();
    final JMenu fileMenu = createJMenu("menu.file");

    final JMenuItem previewItem = new ActionMenuItem(getPreviewAction());
    final JMenuItem exitItem = new ActionMenuItem(getCloseAction());

    fileMenu.add(previewItem);
    fileMenu.addSeparator();
    fileMenu.add(exitItem);
    mb.add(fileMenu);

    // then the help menu
    final JMenu helpMenu = createJMenu("menu.help");
    helpMenu.add(new ActionMenuItem(aboutAction));
    mb.add(helpMenu);
    return mb;
  }
View Full Code Here

        if (someObj instanceof MapPanel && someObj instanceof Container) {
            Debug.message("basic", "OpenMapFrame: Found a MapPanel");
            getContentPane().add((Container) someObj);

            JMenuBar jmb = ((MapPanel) someObj).getMapMenuBar();
            if (jmb != null) {
                Debug.message("basic",
                        "OpenMapFrame: Got MenuBar from MapPanel");
                getRootPane().setJMenuBar(jmb);
            }
View Full Code Here

    /*
     * Constructor.
     */
    public ExampleApplication() {
        _mapBean = new MapBean();
        _menuBar = new JMenuBar();
        _toolPanel = new ToolPanel();
        _omts = new OMToolSet();
        _omts.findAndInit(_mapBean);
        _mouseDelegator = new MouseDelegator(_mapBean);
        _mouseModePanel = new MouseModePanel(_mouseDelegator);
View Full Code Here

    }
   
    protected void build() {
        setLayout(Layout.getGBL());
       
        JMenuBar menu = getMenu();
        if (menu != null) {
            add(menu, Layout.getGBC( 0, 0, 1, 1, 1.0, 1.0
                     ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
                      new Insets(0, 0, 0, 0), 0, 0));
        }
View Full Code Here

       
        cbRecursive.setSelected(((Boolean) DcModules.getCurrent().getSetting(DcRepository.ModuleSettings.stFileImportRecursive)).booleanValue());
    }
   
    protected JMenuBar getMenu() {
        JMenuBar menu = ComponentFactory.getMenuBar();
       
        menu.setPreferredSize(new Dimension(100, 22));
        menu.setMaximumSize(new Dimension(100, 22));
        menu.setMinimumSize(new Dimension(50, 22));
       
        DcMenu menuFilter = ComponentFactory.getMenu(DcResources.getText("lblFileTypes"));
        DcMenuItem menuFileTypes = ComponentFactory.getMenuItem(DcResources.getText("lblFileTypes"));
        menuFilter.add(menuFileTypes);
       
        menu.add(menuFilter);
       
        menuFileTypes.addActionListener(this);
        menuFileTypes.setActionCommand("filterFileTypes");
       
        return menu;
View Full Code Here

        super(parent);
       
        this.parent = parent;
       
        JMenu menu = new FileRenamerMenu(this);
        JMenuBar menuBar = ComponentFactory.getMenuBar();
        menuBar.add(menu);
        setJMenuBar(menuBar);       
       
        setHelpIndex("dc.tools.filerenamer");
        setTitle(DcResources.getText("lblFileRenamePreview"));
       
View Full Code Here

            panels.add(lrp);
        }
    }
   
    private void installMenu() {
        JMenuBar mb = ComponentFactory.getMenuBar();
        JMenu menu = ComponentFactory.getMenu(DcResources.getText("lblEdit"));
       
        JMenuItem miCreate = ComponentFactory.getMenuItem(IconLibrary._icoAdd, DcResources.getText("lblAddLanguage"));
        miCreate.setActionCommand("addLanguage");
        miCreate.addActionListener(this);
       
        menu.add(miCreate);
        mb.add(menu);
       
        setJMenuBar(mb);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JMenuBar

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.