Package javax.swing

Examples of javax.swing.JMenu$MenuChangeListener


   */
  private void initJMenuBar() {
      JMenuBar jMenuBar = new JMenuBar();
        setJMenuBar(jMenuBar);
        //The FILE menu
        JMenu fileMenu = new JMenu(getString("fileMenuTitle"));
        addMenuItem(fileMenu, ACTION_OPEN_FILE);
        addMenuItem(fileMenu, ACTION_SAVE_FILE);
        addMenuItem(fileMenu, ACTION_QUIT);
        jMenuBar.add(fileMenu);
        //The LOGS menu
        JMenu logsMenu = new JMenu(getString("logsMenuTitle"));
        addMenuItem(logsMenu, ACTION_CLEAR_LOGS);
        jMenuBar.add(logsMenu);
        //The Server menu
        JMenu serverMenu = new JMenu(getString("serverMenuTitle"));
        addMenuItem(serverMenu, ACTION_OPEN_SERVER);
        addMenuItem(serverMenu, ACTION_CLOSE_SERVER);
        jMenuBar.add(serverMenu);
        //The options Menu
        JMenu optionsMenu = new JMenu(getString("optionsMenuTitle"));
        addMenuItem(optionsMenu, ACTION_OPTIONS);
        jMenuBar.add(optionsMenu);
    }
View Full Code Here


   
  }
  //----------------------------------------------------------------------
  private void setMainMenu() {
    main_menu_bar = new JMenuBar();
    file = new JMenu();
    fnew = new JMenu();
    view = new JMenu();
    tools = new JMenu();
    help = new JMenu();
    tabs = new JMenu();   
    exit = new JMenuItem();
    new_downloads = new JMenuItem();
    new_servers = new JMenuItem();
    import_server_list = new JMenuItem();
    ButtonGroup radio_button_menu_items_group = new ButtonGroup();
View Full Code Here

        if ((c[i] instanceof JMenu) && ((JMenu)c[i]).getText().equals(subMenu)){
          return createMenuItem(((JMenu)c[i]), suffix, icon);
        }
      }
      //Otherwise, add a new sub menu
      JMenu sm = new JMenu(subMenu);
      currentMenu.add(sm);
      return createMenuItem(sm, suffix, icon)
    }
  }
View Full Code Here

  /** Adds a menu entry in the tools menu */
 
  public void setMenu(JMenuBar mb) {
    Component c[] = mb.getComponents();
    JMenu jm =null;
    boolean found=false;
   
    for (int i=0; i<c.length; ++i) {
      jm = (JMenu)c[i];
      if (jm.getText().equals(resources.getString("data"))) {
        found=true;
        break;
      }
    }
    if (!found){
      jm = new JMenu(resources.getString("data"));
      mb.add(jm);
    }
    mergeItem= new JMenuItem(resources.getString("merge"));
    mergeItem.setIcon(resources.getIcon("mergeDataImage"));
   
    mergeItem.addActionListener(this);
    jm.add(mergeItem);
  }
View Full Code Here

        arrowButton.addMouseListener(new DropDownListener());

        setEnabled(false);

        // menu bar
        menu = new JMenu();
        menu.getPopupMenu().addContainerListener(new MenuContainerListener());

        if (actions != null){
            for(int i=0;i < actions.size();i++){
                JMenuItem mi = new JMenuItem( (Action)actions.get(i));
View Full Code Here

    catch(MissingResourceException mre){
    }
    if(iname==null){
      return null;
    }
    JMenu res=new JMenu(iname);

    String mname=null;
    try{
      mname=getString(name+"Mnemonic");
    }
    catch(MissingResourceException mre){
    }
    if(mname!=null){
      res.setMnemonic(mname.charAt(0));
    }
    else{
      res.setMnemonic(iname.charAt(0));
    }
    return res;
  }
View Full Code Here

    public JMenu createMenu(String name, boolean enableCloseAll) {
        if (_menu != null) {
            return null;
        }
        if (name != null) {
            _menu = new JMenu(name);
            _menu.setMnemonic(name.charAt(0));
        } else {
            _menu = _resources.getMenu("windows");
        }
View Full Code Here

 
  /** Adds a menu entry in the tools menu */
  public void setMenu(JMenuBar mb) {
    Component c[] = mb.getComponents();
    for (int i=0; i<c.length; ++i) {
      JMenu jm = (JMenu)c[i];
      if (jm.getText().equals(JSynopticPanels.resources.getString("toolsMenu"))) {
        jmi = new JMenuItem(resources.getString("LookAndFeel..."));
        jm.add(jmi);
        jmi.addActionListener(this);
      }
    }
  }
View Full Code Here

        miNewAs.setIcon(resources.getIcon("newImage"));
        miNewAs.setEnabled(isEditable);

        jmFile.add(miOpen = resources.getItem("open", this));
        miOpen.setIcon(resources.getIcon("openImage"));
        miRecentFiles = new JMenu(resources.getString("openRecentFiles"));
        miRecentFiles.setIcon(resources.getIcon("emptyImage"));
        jmFile.add(miRecentFiles);
        // Recent files names are added as items to the miOpenRecentFiles menu.
        String recentFilesProperty = Run.getProperties().getString("jsynoptic.ui.JSynoptic.recentFiles", null);
        if ((recentFilesProperty != null) && !recentFilesProperty.equals("")) {
View Full Code Here

        if (!USE_SELECTION_TOOL_BOXES) {
            addDepthMenu(popup);
            addAlignMenu(popup);
            popup.addSeparator();
            // Group actions
            JMenu group = new JMenu("Group");
            item = group.add(aGroup);
            item.setIcon(resources.getIcon("groupImage"));
            item = group.add(aUngroup);
            item.setIcon(resources.getIcon("ungroupImage"));
            item = group.add(aRegroup);
            item.setIcon(resources.getIcon("regroupImage"));
            popup.add(group);
            popup.addSeparator();
        }
        // Edit Action
View Full Code Here

TOP

Related Classes of javax.swing.JMenu$MenuChangeListener

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.