Package javax.swing

Examples of javax.swing.JMenuBar


      mShowSearchFieldCb.setEnabled(false);
    }
  }

  private void setMainframeMenusEnabled(boolean enabled) {
    JMenuBar bar = MainFrame.getInstance().getJMenuBar();

    for (int i = 0; i < bar.getMenuCount(); i++) {
      JMenu menu = bar.getMenu(i);
      if (menu != null) {
        menu.setEnabled(enabled);
      }
    }
  }
View Full Code Here


    frmEverbox.setResizable(false);
    frmEverbox.setTitle("Everbox \u7BA1\u7406\u5668");
    frmEverbox.setBounds(100, 100, 450, 600);
    frmEverbox.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
   
    JMenuBar menuBar = new JMenuBar();
    frmEverbox.setJMenuBar(menuBar);
   
    JMenu FileMenu = new JMenu("File");
    menuBar.add(FileMenu);
   
    JMenuItem ExitMenuItem = new JMenuItem("\u9000\u51FA");
    ExitMenuItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        client.run = false;
        stopClientButton.setText("正在关闭,请等候");
        while(true) {
          if(clientThread.isAlive())
            try {
              Thread.sleep(1000);
            } catch (Throwable e1) {
            }
          break;
        }
        frmEverbox.dispose();
      }
    });
    FileMenu.add(ExitMenuItem);
   
    JMenu cleanMenu = new JMenu("\u6E05\u7406");
    menuBar.add(cleanMenu);
   
    JMenuItem mntmNewMenuItem = new JMenuItem("\u6E05\u7406\u767B\u9646\u4FE1\u606F");
    mntmNewMenuItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        File f = new File("everbox.data");
        if(f.exists())
          f.delete();
      }
    });
    mntmNewMenuItem.setEnabled(false);
    cleanMenu.add(mntmNewMenuItem);
   
    JMenuItem mntmNewMenuItem_1 = new JMenuItem("\u6E05\u7406\u65E5\u5FD7\u4FE1\u606F");
    mntmNewMenuItem_1.setEnabled(false);
    cleanMenu.add(mntmNewMenuItem_1);
   
    JMenuItem mntmNewMenuItem_3 = new JMenuItem("\u6E05\u7406\u4E0B\u8F7D\u7528\u5230\u7684\u4E34\u65F6\u6587\u4EF6");
    mntmNewMenuItem_3.setEnabled(false);
    cleanMenu.add(mntmNewMenuItem_3);
   
    JMenuItem mntmNewMenuItem_4 = new JMenuItem("\u6E05\u7406\u6587\u4EF6\u6570\u636E\u5E93");
    mntmNewMenuItem_4.setEnabled(false);
    cleanMenu.add(mntmNewMenuItem_4);
   
    JMenu helpMenu = new JMenu("\u5E2E\u52A9");
    menuBar.add(helpMenu);
   
    JMenuItem vistHomepageMenuItem = new JMenuItem("\u8BBF\u95EE\u9879\u76EE\u9996\u9875");
    vistHomepageMenuItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
View Full Code Here

  private void updateMenu(final JMenu[] menus)
  {
    if (menus != null && menus.length > 0)
    {
      final JMenuBar menuBar = new JMenuBar();
      for (int i = 0; i < menus.length; i++)
      {
        final JMenu menu = menus[i];
        menuBar.add(menu);
      }
      setJMenuBar(menuBar);
    }
    else
    {
View Full Code Here

      {
        // Update the menu
        final JMenu[] menus = previewPane.getMenu();
        if (menus != null && menus.length > 0)
        {
          final JMenuBar menuBar = new JMenuBar();
          for (int i = 0; i < menus.length; i++)
          {
            final JMenu menu = menus[i];
            menuBar.add(menu);
          }
          setJMenuBar(menuBar);
        }
        else
        {
View Full Code Here

  private void updateMenu(final JMenu[] menus)
  {
    if (menus != null && menus.length > 0)
    {
      final JMenuBar menuBar = new JMenuBar();
      for (int i = 0; i < menus.length; i++)
      {
        final JMenu menu = menus[i];
        menuBar.add(menu);
      }
      setJMenuBar(menuBar);
    }
    else
    {
View Full Code Here

  private void updateMenu(final JMenu[] menus)
  {
    if (menus != null && menus.length > 0)
    {
      final JMenuBar menuBar = new JMenuBar();
      for (int i = 0; i < menus.length; i++)
      {
        final JMenu menu = menus[i];
        menuBar.add(menu);
      }
      setJMenuBar(menuBar);
    }
    else
    {
View Full Code Here

      {
        // Update the menu
        final JMenu[] menus = previewPane.getMenu();
        if (menus != null && menus.length > 0)
        {
          final JMenuBar menuBar = new JMenuBar();
          for (int i = 0; i < menus.length; i++)
          {
            final JMenu menu = menus[i];
            menuBar.add(menu);
          }
          setJMenuBar(menuBar);
        }
        else
        {
View Full Code Here

    actionsMenu.add(new ShowPropertiesAction());
    actionsMenu.add(new ShowModifiedAction());
    actionsMenu.addSeparator();
    actionsMenu.add(exitAction);

    final JMenuBar menuBar = new JMenuBar();
    menuBar.add(actionsMenu);
    setJMenuBar(menuBar);

    final JToolBar toolBar = new JToolBar();
    toolBar.add(sortAction);
    toolBar.add(new EditExpressionAction());
View Full Code Here

    menuBarInfo.setSupportsAnchor(false);
  };

  public MenuBar(Widget parent, String name) throws GUIException {
    super(parent, name);
    menuBar = new JMenuBar();
  }
View Full Code Here

        this.module = module;
    }
   
    @Override
    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

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.