Package javax.swing

Examples of javax.swing.JMenu.addMenuListener()


    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)
        {
          ((JMenu) e.getSource()).setEnabled(action.isEnabled());
View Full Code Here


            if(mnemonic!=0)
                menu.setMnemonic(mnemonic);
        }

        if(menuListener!=null)
            menu.addMenuListener(menuListener);
   
        return menu;
    }
 
 
View Full Code Here

                action.putValue( "InstrumentManagerConnection", connection );

                JMenu menu = new LargeMenu( action );

                // Set up a Listener to handle the selected event.
                menu.addMenuListener( new MenuListener()
                {
                    public void menuSelected( MenuEvent event )
                    {
                        JMenu menu = (JMenu)event.getSource();
                        Action action = menu.getAction();
View Full Code Here

                    action.putValue( "InstrumentableData", instrumentable );

                    JMenu menu = new LargeMenu( action );

                    // Set up a Listener to handle the selected event.
                    menu.addMenuListener( new MenuListener()
                    {
                        public void menuSelected( MenuEvent event )
                        {
                            JMenu menu = (JMenu)event.getSource();
                            Action action = menu.getAction();
View Full Code Here

                action.putValue( "InstrumentableData", child );

                JMenu menu = new LargeMenu( action );

                // Set up a Listener to handle the selected event.
                menu.addMenuListener( new MenuListener()
                {
                    public void menuSelected( MenuEvent event )
                    {
                        JMenu menu = (JMenu)event.getSource();
                        Action action = menu.getAction();
View Full Code Here

                action.putValue( "InstrumentData", instrument );

                JMenu menu = new LargeMenu( action );

                // Set up a Listener to handle the selected event.
                menu.addMenuListener( new MenuListener()
                {
                    public void menuSelected( MenuEvent event )
                    {
                        JMenu menu = (JMenu)event.getSource();
                        Action action = menu.getAction();
View Full Code Here

  options.add(ssuper);
  sclass = new JCheckBoxMenuItem("Service classes", false);
  options.add(sclass);
  bar.add(options);
  JMenu services = new JMenu("Services");
  services.addMenuListener(wrap(new Services(services)));
  bar.add(services);
  JMenu attrs = new JMenu("Attributes");
  attrs.addMenuListener(wrap(new Entries(attrs)));
  bar.add(attrs);
  setJMenuBar(bar);
View Full Code Here

  bar.add(options);
  JMenu services = new JMenu("Services");
  services.addMenuListener(wrap(new Services(services)));
  bar.add(services);
  JMenu attrs = new JMenu("Attributes");
  attrs.addMenuListener(wrap(new Entries(attrs)));
  bar.add(attrs);
  setJMenuBar(bar);

  getContentPane().setLayout(new BorderLayout());
  int textRows = 8;
View Full Code Here

      }
      Entry[] attrs = tmpl.attributeSetTemplates;
      for (int i = 0; i < attrs.length; i++) {
    Class type = attrs[i].getClass();
    JMenu item = new JMenu(typeName(type));
    item.addMenuListener(new Fields(item, i));
    menu.add(item);
      }
      Class[] types;
      try {
    types = lookup.getEntryClasses(tmpl);
View Full Code Here

      item.addActionListener(
          wrap(new Value(index, field, null)));
      menu.add(item);
        } else {
      JMenu item = new JMenu(field.getName());
      item.addMenuListener(
          wrap(new Values(item, index, field)));
      menu.add(item);
        }
    } catch (Throwable t) {
        logger.log(Level.INFO, "getting fields failed", t);
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.