Examples of JMenuItem


Examples of javax.swing.JMenuItem

                    setActiveComponent(getComponent(tabbedPane.getSelectedIndex()));
                }
            }
        });
        JPopupMenu popup = new JPopupMenu();
        JMenuItem close = new JMenuItem("Close");
        close.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                close(getComponent(tabbedPane.getSelectedIndex()));
            }
        });
View Full Code Here

Examples of javax.swing.JMenuItem

    if (!x && getComponentCount() > 0) { remove(getComponentCount() - 1); }
  }
 
  private boolean add(LogisimMenuItem item, String display) {
    if (shouldShow(item)) {
      JMenuItem menu = new JMenuItem(display);
      items.put(item, menu);
      menu.setEnabled(isEnabled(item));
      menu.addActionListener(listener);
      add(menu);
      return true;
    } else {
      return false;
    }
View Full Code Here

Examples of javax.swing.JMenuItem

    public void configureMenu(JPopupMenu menu, Project proj) {
      this.proj = proj;
      String name = instance.getFactory().getDisplayName();
      String text = Strings.get("subcircuitViewItem", name);
      JMenuItem item = new JMenuItem(text);
      item.addActionListener(this);
      menu.add(item);
    }
View Full Code Here

Examples of javax.swing.JMenuItem

    menu.add(load);
    menu.add(save);
  }

  private JMenuItem createItem(boolean enabled, String label) {
    JMenuItem ret = new JMenuItem(label);
    ret.setEnabled(enabled);
    ret.addActionListener(this);
    return ret;
  }
View Full Code Here

Examples of javax.swing.JMenuItem

  public void insert(String s, int pos) {
    if (pos < 0) {
      throw new IllegalArgumentException("index less than zero.");
    }

    insert(new JMenuItem(s), pos);

  }
View Full Code Here

Examples of javax.swing.JMenuItem

  public JMenuItem insert(Action a, int pos) {
    if (pos < 0) {
      throw new IllegalArgumentException("index less than zero.");
    }

    JMenuItem menuItem = new JMenuItem((String) a.getValue(Action.NAME), (Icon) a.getValue(Action.SMALL_ICON));
    menuItem.setHorizontalTextPosition(SwingConstants.TRAILING);
    menuItem.setVerticalTextPosition(SwingConstants.CENTER);
    menuItem.setEnabled(a.isEnabled());
    menuItem.setAction(a);
    insert(menuItem, pos);

    return menuItem;
  }
View Full Code Here

Examples of javax.swing.JMenuItem

  public JMenuItem getItem(int pos) {
    if (pos < 0) {
      throw new IllegalArgumentException("index less than zero.");
    }

    JMenuItem menuItem = null;

    Component component = getMenuComponent(pos);
    if (component instanceof JMenuItem) {
      menuItem = (JMenuItem) component;
    }
View Full Code Here

Examples of javax.swing.JMenuItem

  /**
   * Init the session menu.
   */
  private void initSessionMenu() {
    sessionMenu = new JMenu(this.properties.getValue("sessionMenu"));
    JMenuItem openSession = new JMenuItem(properties.getValue("openSession"));
    JMenuItem closeSession = new JMenuItem(properties.getValue("closeSession"));
    JMenuItem exit = new JMenuItem(properties.getValue("exit"));

    exit.addActionListener(new QuitAppli());
    closeSession.addActionListener(new CloseSession());
    //this.sessionMenu.add(openSession);
    this.sessionMenu.add(closeSession);
    this.sessionMenu.add(exit);

View Full Code Here

Examples of javax.swing.JMenuItem

  /**
   * Init the option menu.
   */
  private void initOptionsMenu() {
    optionsMenu = new JMenu(this.properties.getValue("optionsMenu"));
    JMenuItem options = new JMenuItem(properties.getValue("options"));
    JMenuItem help = new JMenuItem(properties.getValue("help"));
    JMenuItem about = new JMenuItem(properties.getValue("about"));

    options.addActionListener(new SetOptions(this.properties, MainFrame.myRef));
    help.addActionListener(new LaunchHelp());
    about.addActionListener(new AboutHamsam());

    this.optionsMenu.add(options);
    this.optionsMenu.add(help);
    this.optionsMenu.add(about);

View Full Code Here

Examples of javax.swing.JMenuItem

    mSource = src;
    mChannel = ch;
    mComponent = e.getComponent();

    mMenu = new JPopupMenu();
    mChAdd = new JMenuItem(mLocalizer.msg("addChannels", "Add/Remove channels"));
    mChConf = new JMenuItem(mLocalizer.msg("configChannel", "Setup channel"),
        TVBrowserIcons.edit(TVBrowserIcons.SIZE_SMALL));
    mChGoToURL = new JMenuItem(mLocalizer.msg("openURL", "Open internet page"),
        IconLoader.getInstance().getIconFromTheme("apps",
            "internet-web-browser"));

    // dynamically create filters from available channel filter components
    mFilterChannels = new JMenu(mLocalizer.msg("filterChannels",
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.