Package javax.swing

Examples of javax.swing.JMenu.addActionListener()


      e = mimeTypes.keys();

      while(e.hasMoreElements()) {
    String major = (String)e.nextElement();
    JMenu imenu = new JMenu(major);
    imenu.addActionListener(this);
    minor = (String[]) mimeTypes.get(major);
    for(int i = 0 ; i < minor.length ; i++) {
        item = new JMenuItem(minor[i]);
        addMenuListener(item, major + "/" + minor[i]);
        imenu.add(item);
View Full Code Here


   
    JMenu menu = new JMenu((String) action.getValue(Action.NAME));
    if (action.getValue(Action.SMALL_ICON) != null)
      menu.setIcon((Icon) action.getValue(Action.SMALL_ICON));
    menu.setMnemonic(((String) action.getValue(Action.MNEMONIC_KEY)).charAt(0));
    menu.addActionListener(action);
    menu.addMenuListener(
      new MenuListener()
      {
        public void menuSelected(MenuEvent e)
        {
View Full Code Here

  {
    JMenu menu = new JMenu((String) action.getValue(Action.NAME));
    if (action.getValue(Action.SMALL_ICON) != null)
      menu.setIcon((Icon) action.getValue(Action.SMALL_ICON));
    menu.setMnemonic(((String) action.getValue(Action.MNEMONIC_KEY)).charAt(0));
    menu.addActionListener(action);
    if (items == null)
      return null;
    for (int i = 0; i < items.length; i++)
    {
      if (items[i] == null)
View Full Code Here

    final JMenuBar menuBar = new JMenuBar();
    menuBar.setLayout(null);
    setJMenuBar(menuBar);

    final JMenu menu = new JMenu();
    menu.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent arg0) {
      }
    });
    menu.setText("Menu");
    menu.setBounds(0, 0, 120, 30);
View Full Code Here

    final JMenuItem configureControlsMenuItem = new JMenuItem();
    configureControlsMenuItem.setText("Configure controls");
    settingsMenu.add(configureControlsMenuItem);

    final JMenu helpMenu = new JMenu();
    helpMenu.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent arg0) {
      }
    });
    helpMenu.setText("Help");
    helpMenu.setBounds(0, 0, 120, 30);
View Full Code Here

                } else
                    menu.setText(getMenuTxt(menuName));
                String command = rs.getString("COMMAND");
                if (command != null) {
                    menu.setActionCommand(command);
                    menu.addActionListener(listener);
                }                       
                String icon = rs.getString("ICON");
                if (icon != null)
                    menu.setIcon(ImageManager.getImage(icon));
            } else {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.