Tabnine Logo
JCheckBoxMenuItem.getText
Code IndexAdd Tabnine to your IDE (free)

How to use
getText
method
in
javax.swing.JCheckBoxMenuItem

Best Java code snippets using javax.swing.JCheckBoxMenuItem.getText (Showing top 15 results out of 315)

origin: mucommander/mucommander

  public void actionPerformed(ActionEvent e) {
    String oldEncoding = selectedEncoding;
    selectedEncoding = ((JCheckBoxMenuItem)e.getSource()).getText();
    if(!oldEncoding.equals(selectedEncoding)) {
      // Notify listeners of the new encoding
      fireEncodingListener(oldEncoding, EncodingMenu.this.selectedEncoding);
    }
  }
});
origin: stackoverflow.com

 JCheckBoxMenuItem item = new JCheckBoxMenuItem(new AbstractAction("...") {
  // Store the object here.
  private String someObject;

  public void actionPerformed(ActionEvent e) {
    JCheckBoxMenuItem source = (JCheckBoxMenuItem) e.getSource();
    if (source.isSelected()) {
      someObject = "Object " + source.getText(); // trivial.
      someList.add(someObject);
    }
    else {
      someList.remove(someObject);
      someObject = null;
    }
  }
});
origin: org.fudaa.framework.ctulu/ctulu-bu

public Icon getIcon()
{
 if(BuPreferences.BU.getBooleanProperty("icons.menu",true)||
   (super.getText()==null))
  return super.getIcon();
 return null;
}
origin: Audiveris/audiveris

/**
 * Triggered from popup menu.
 *
 * @param e menu item event
 */
@Override
public void itemStateChanged (ItemEvent e)
{
  JCheckBoxMenuItem item = (JCheckBoxMenuItem) e.getItem();
  Board board = getBoard(item.getText());
  board.setSelected(item.getState());
}
origin: nroduit/Weasis

  @Override
  public void showPopup(Component invoker, int x, int y) {
    final SynchData synch = (SynchData) getActionValue(ActionW.SYNCH_LINK.cmd());
    if (synch == null) {
      return;
    }
    JPopupMenu popupMenu = new JPopupMenu();
    TitleMenuItem itemTitle = new TitleMenuItem(ActionW.SYNCH.getTitle(), popupMenu.getInsets());
    popupMenu.add(itemTitle);
    popupMenu.addSeparator();
    for (Entry<String, Boolean> a : synch.getActions().entrySet()) {
      JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(a.getKey(), a.getValue());
      menuItem.addActionListener(e -> {
        if (e.getSource() instanceof JCheckBoxMenuItem) {
          JCheckBoxMenuItem item = (JCheckBoxMenuItem) e.getSource();
          synch.getActions().put(item.getText(), item.isSelected());
        }
      });
      popupMenu.add(menuItem);
    }
    popupMenu.show(invoker, x, y);
  }
}, SYNCH_ICON);
origin: stackoverflow.com

frame.pack();
   frame.setLocationRelativeTo(null);
   frame.setVisible(true);
   SwingUtilities.invokeLater(new Runnable() {
     public void run() {
      for (int i = 0; i < menuBar.getMenuCount(); i++) {
        JMenu menu = menuBar.getMenu(i);
        if ("View".equals(menu.getText())) {
         int componentCount = menu.getMenuComponentCount();
         for (int j = 0; j < componentCount; j++) {
           Component c = menu.getMenuComponent(j);
           if (c instanceof JCheckBoxMenuItem) {
            JCheckBoxMenuItem chkBoxMenuItem = (JCheckBoxMenuItem) c;
            String text = chkBoxMenuItem.getText();
            if ("Show SearchPanel".equals(text)) {
              chkBoxMenuItem.doClick();
            }
           }
         }
        }
      }
     }
   });
origin: net.sourceforge.jadex/jadex-tools-comanalyzer

boolean	selected = props.getBooleanProperty(checkboxes[i].getText());
origin: nroduit/Weasis

@Override
public JMenu createMenu(String title) {
  JMenu menu = new JMenu(title);
  for (CheckBoxModel item : itemList) {
    Icon icon = null;
    if (item.getObject() instanceof GUIEntry) {
      icon = ((GUIEntry) item.getObject()).getIcon();
    }
    JCheckBoxMenuItem box = new JCheckBoxMenuItem(item.getObject().toString(), icon, item.isSelected());
    box.addActionListener(e -> {
      if (e.getSource() instanceof JCheckBoxMenuItem) {
        JCheckBoxMenuItem btn = (JCheckBoxMenuItem) e.getSource();
        if (startBySelectAll && itemList.get(0).getObject().toString().equals(btn.getText())) {
          selectAll(menu, btn.isSelected());
        } else {
          item.setSelected(btn.isSelected());
        }
      }
    });
    menu.add(box);
  }
  return menu;
}
origin: org.netbeans.api/org-openide-explorer

  @Override
  public void itemStateChanged(ItemEvent e) {
    JCheckBoxMenuItem cMenu = (JCheckBoxMenuItem) e.getItemSelectable();
    if (cMenu == matchCase) {
      qss.setMatchCase(cMenu.isSelected());
    } else {
      String cName = cMenu.getText();
      if (cMenu.isSelected()) {
        qss.addColumnToSearch(cName);
      } else {
        qss.removeColumnFromSearch(cName);
      }
    }
    doSearchAction.actionPerformed(null);
    //doSearch(lastSearchText, Bias.Forward);
  }
};
origin: net.sourceforge.jadex/jadex-tools-comanalyzer

  /**
   * Get plugin properties to be saved in a project.
   */
  public IFuture getProperties()
  {
    Properties    props    = new Properties();
    for(int i=0; i<checkboxes.length; i++)
    {
//            System.out.println(""+checkboxes[i].getText()+" "+checkboxes[i].isSelected());
      props.addProperty(new Property(checkboxes[i].getText(), ""+checkboxes[i].isSelected()));
    }
    return new Future(props);
  }
   
origin: edu.toronto.cs.savant/savant-core

  @Override
  public void actionPerformed(ActionEvent e) {
    JCheckBoxMenuItem item = (JCheckBoxMenuItem)e.getSource();
    if (item.getState()) {
      DrawingMode[] validModes = mainTrack.getValidDrawingModes();
      for (int j = 0; j < modeItems.length; j++) {
        if (item.getText().equals(validModes[j].getDescription())) {
          for (TrackAdapter t: frame.getTracks()) {
            AnalyticsAgent.log(
                new NameValuePair[] {
                    new NameValuePair("track-event","DisplayModeChanged"),
                    new NameValuePair("track-type",t.getClass().getSimpleName()),
                    new NameValuePair("target-mode",validModes[j].getDescription())
                  }
                );
            t.setDrawingMode(validModes[j]);
          }
          drawModePosition = j;
        } else {
          modeItems[j].setState(false);
        }
      }
    } else {
      item.setState(true);
    }
  }
});
origin: net.sf.mmax2/mmax2

if (item.isSelected())
  toBeExecuted.add(item.getText());
origin: com.dorkbox/SystemTray

checkbox.setChecked(entry.getState());
checkbox.setShortcut(entry.getMnemonic());
checkbox.setText(entry.getText());
origin: com.github.axet/desktop

item.setTitle(new NSString(ch.getText()));
item.setImage(bm);
item.setEnabled(ch.isEnabled());
origin: com.github.axet/desktop

item.setTitle(new NSString(ch.getText()));
item.setImage(bm);
item.setEnabled(ch.isEnabled());
javax.swingJCheckBoxMenuItemgetText

Popular methods of JCheckBoxMenuItem

  • <init>
  • setSelected
  • addActionListener
  • isSelected
  • setEnabled
  • setState
  • setText
  • getState
  • addItemListener
  • setMnemonic
  • setToolTipText
  • setActionCommand
  • setToolTipText,
  • setActionCommand,
  • setAccelerator,
  • setAction,
  • setIcon,
  • setName,
  • getModel,
  • addChangeListener,
  • getActionCommand

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now