Codota Logo
JCheckBoxMenuItem.getText
Code IndexAdd Codota 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)

  • Common ways to obtain JCheckBoxMenuItem
private void myMethod () {
JCheckBoxMenuItem j =
  • Codota Iconnew JCheckBoxMenuItem()
  • Codota IconString str;new JCheckBoxMenuItem(str)
  • Codota IconAction action;new JCheckBoxMenuItem(action)
  • Smart code suggestions by Codota
}
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

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • JComboBox (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now