Package javax.swing

Examples of javax.swing.JCheckBoxMenuItem.addActionListener()


  }

  private JMenuItem buildShowHideElement(final MapElement mapElement) {
    final JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(
        "Afficher le personnage aux joueurs");
    menuItem.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        mapElement.setHiddenForPlayer(!mapElement.isHiddenForPlayer());
        menuItem.setSelected(mapElement.isHiddenForPlayer());
      }
View Full Code Here


        // add the given items to the popup menu.
        for (int i = 0; i < fComboBox.getModel().getSize(); i++) {
            Object item = fComboBox.getModel().getElementAt(i);
            JMenuItem menuItem = new JCheckBoxMenuItem(item.toString());
            menuItem.setFont(fFont);
            menuItem.addActionListener(createMenuItemListener(item));
            buttonGroup.add(menuItem);
            fPopupMenu.add(menuItem);

            // if the current item is selected, make the menu item reflect that.
            if (item.equals(fComboBox.getModel().getSelectedItem())) {
View Full Code Here

        advancedOptions = setMenuItem(optionsMenu, optionsListener,
                    new String[] {CBIntText.get("Advanced Options"), "d", CBIntText.get("Open the Advanced Options dialog."), "E", ""} );

        // add *another* action listener for specific handling...
        browserSearchAliases.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                try
                {
                    if (browserSearchAliases.isSelected())
                    {
View Full Code Here

                menu.add(new JSeparator());
            else
            {
                JCheckBoxMenuItem tmp = new JCheckBoxMenuItem(menuItems[i][0], new ImageIcon(menuItems[i][5]), (menuItems[i][4].charAt(0)=='C'));
                setMenuItemState(menu, tmp, menuItems[i][1], menuItems[i][2], (menuItems[i][3].charAt(0)=='E'));
                if (listener != null) tmp.addActionListener(listener);
            }
        }
    }

    /**
 
View Full Code Here

            String actionCommand, KeyStroke keyStroke){
        JCheckBoxMenuItem cbkMenuItem = new JCheckBoxMenuItem(JMeterUtils.getResString(resource));
        cbkMenuItem.setName(resource);
        cbkMenuItem.setActionCommand(actionCommand);
        cbkMenuItem.setAccelerator(keyStroke);
        cbkMenuItem.addActionListener(ActionRouter.getInstance());
        return cbkMenuItem;
    }
}
View Full Code Here

      popup.add(editMenu) ;
      popup.add(chainMenu) ;
      // popup.add(autoScroll) ;
     
      autoScroll.setSelected(table.isAutoScroll()) ;
      autoScroll.addActionListener(new ActionListener()
      {     
         public void actionPerformed(ActionEvent e)
         {
            table.setAutoscrolls(autoScroll.isSelected()) ;     
         }     
View Full Code Here

        for (String chapter : pageChapters) {
          boolean active = Suggestion.isChapterActive(page, chapter);
          JMenuItem chapterItem = new JCheckBoxMenuItem(chapter);
          chapterItem.setSelected(active);
          chapterItem.setActionCommand(page + "#" + chapter);
          chapterItem.addActionListener(EventHandler.create(
              ActionListener.class, this,
              active ? "actionCheckSpellingDeactivateChapter" : "actionCheckSpellingActivateChapter",
              "actionCommand"));
          pageMenu.add(chapterItem);
        }
View Full Code Here

      } else {
        boolean active = Suggestion.isChapterActive(page, pageChapters.get(0));
        JMenuItem pageItem = new JCheckBoxMenuItem(page);
        pageItem.setSelected(active);
        pageItem.setActionCommand(page + "#" + pageChapters.get(0));
        pageItem.addActionListener(EventHandler.create(
            ActionListener.class, this,
            active ? "actionCheckSpellingDeactivateChapter" : "actionCheckSpellingActivateChapter",
                "actionCommand"));
        menu.add(pageItem);
      }
View Full Code Here

  }

  // TODO: Never USED
  public JCheckBoxMenuItem createMenuCheckBox(String label, String actionCommand) {
    JCheckBoxMenuItem item = new JCheckBoxMenuItem(label);
    item.addActionListener(this);
    item.setActionCommand(actionCommand);
    return item;
  }

  private void CompileSelected() {
View Full Code Here

      if ((id != null) && (id.intValue() >= 0)) {
        boolean active = !filtered.contains(Integer.toString(ns.getId()));
        JMenuItem item = new JCheckBoxMenuItem(
            ns.toString(), active);
        item.setActionCommand(id.toString());
        item.addActionListener(EventHandler.create(
            ActionListener.class, this,
            active ? "actionFilterNamespaceTrue" : "actionFilterNamespaceFalse",
            "actionCommand"));
        menuFilter.add(item);
      }
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.