Codota Logo
JCheckBoxMenuItem.addActionListener
Code IndexAdd Codota to your IDE (free)

How to use
addActionListener
method
in
javax.swing.JCheckBoxMenuItem

Best Java code snippets using javax.swing.JCheckBoxMenuItem.addActionListener (Showing top 20 results out of 936)

  • 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: log4j/log4j

protected JCheckBoxMenuItem createMenuItem(LogLevel level) {
 JCheckBoxMenuItem result = new JCheckBoxMenuItem(level.toString());
 result.setSelected(true);
 result.setMnemonic(level.toString().charAt(0));
 result.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
   _table.getFilteredLogTableModel().refresh();
   updateStatusLabel();
  }
 });
 return result;
}
origin: log4j/log4j

protected JCheckBoxMenuItem createLogTableColumnMenuItem(LogTableColumn column) {
 JCheckBoxMenuItem result = new JCheckBoxMenuItem(column.toString());
 result.setSelected(true);
 result.setMnemonic(column.toString().charAt(0));
 result.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
   // update list of columns and reset the view
   List selectedColumns = updateView();
   _table.setView(selectedColumns);
  }
 });
 return result;
}
origin: deathmarine/Luyten

packageExplorerStyle = new JCheckBoxMenuItem("Package Explorer Style");
packageExplorerStyle.setSelected(luytenPrefs.isPackageExplorerStyle());
packageExplorerStyle.addActionListener(new ActionListener() {
  @Override
  public void actionPerformed(ActionEvent e) {
filterOutInnerClassEntries.addActionListener(new ActionListener() {
  @Override
  public void actionPerformed(ActionEvent e) {
singleClickOpenEnabled.addActionListener(new ActionListener() {
  @Override
  public void actionPerformed(ActionEvent e) {
exitByEscEnabled.addActionListener(new ActionListener() {
  @Override
  public void actionPerformed(ActionEvent e) {
origin: skylot/jadx

heapUsageBarMenuItem.addActionListener(event -> {
  settings.setShowHeapUsageBar(!settings.isShowHeapUsageBar());
  heapUsageBar.setVisible(settings.isShowHeapUsageBar());
flatPkgButton.setSelected(isFlattenPackage);
ActionListener flatPkgAction = e -> toggleFlattenPackage();
flatPkgMenuItem.addActionListener(flatPkgAction);
flatPkgButton.addActionListener(flatPkgAction);
flatPkgButton.setToolTipText(NLS.str("menu.flatten"));
origin: deathmarine/Luyten

flattenSwitchBlocks = new JCheckBoxMenuItem("Flatten Switch Blocks");
flattenSwitchBlocks.setSelected(settings.getFlattenSwitchBlocks());
flattenSwitchBlocks.addActionListener(settingsChanged);
settingsMenu.add(flattenSwitchBlocks);
forceExplicitImports.addActionListener(settingsChanged);
settingsMenu.add(forceExplicitImports);
forceExplicitTypes.addActionListener(settingsChanged);
settingsMenu.add(forceExplicitTypes);
showSyntheticMembers.addActionListener(settingsChanged);
settingsMenu.add(showSyntheticMembers);
excludeNestedTypes.addActionListener(settingsChanged);
settingsMenu.add(excludeNestedTypes);
retainRedundantCasts.addActionListener(settingsChanged);
settingsMenu.add(retainRedundantCasts);
unicodeReplacement.addActionListener(settingsChanged);
settingsMenu.add(unicodeReplacement);
debugLineNumbers.addActionListener(settingsChanged);
settingsMenu.add(debugLineNumbers);
showDebugInfo = new JCheckBoxMenuItem("Include Error Diagnostics");
showDebugInfo.setSelected(settings.getIncludeErrorDiagnostics());
showDebugInfo.addActionListener(settingsChanged);
origin: marytts/marytts

jCheckBoxMenuItem_SpeakerWindow.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
    jCheckBoxMenuItem_SpeakerWindowActionPerformed(evt);
origin: chewiebug/GCViewer

public void initGCViewerGui(GCViewerGui gui, GCModelLoaderController controller) {
  Image iconImage = ImageHelper.loadImage("gcviewericon.gif");
  gui.setIconImage(iconImage);
  Map<String, Action> actionMap = initActionMap(controller, gui, iconImage);
  GCViewerGuiMenuBar menuBar = initMenuBar(actionMap, gui, controller);
  GCViewerGuiToolBar toolBar = initToolBar(actionMap);
  JDesktopPane desktopPane = initDesktopPane(gui, controller);
  
  WatchStateController wsListener = new WatchStateController(menuBar.getWatchMenuItem(), toolBar.getWatchToggleButton());
  menuBar.getWatchMenuItem().addActionListener(wsListener);
  toolBar.getWatchToggleButton().addActionListener(wsListener);
  
  gui.setActionMap(actionMap);
  gui.setJMenuBar(menuBar);
  gui.setToolBar(toolBar);
  gui.setDesktopPane(desktopPane);
}
origin: magefree/mage

separateButton.addActionListener(e -> {
  setSeparateCreatures(!separateCreatures);
  resort();
origin: winder/Universal-G-Code-Sender

private void initComponents() {
  consoleTextArea.setEditable(false);
  consoleTextArea.setColumns(20);
  consoleTextArea.setDocument(new LengthLimitedDocument(CONSOLE_SIZE));
  consoleTextArea.setRows(5);
  consoleTextArea.setMaximumSize(new java.awt.Dimension(32767, 32767));
  consoleTextArea.setMinimumSize(new java.awt.Dimension(0, 0));
  scrollPane.setViewportView(consoleTextArea);
  commandLabel.setEnabled(backend.isIdle());
  scrollWindowMenuItem.addActionListener(e -> checkScrollWindow());
  setLayout(new MigLayout("inset 0 0 5 0, fill, wrap 1", "", "[][min!]"));
  add(scrollPane, "grow, growy");
  add(commandLabel, "gapleft 5, al left, split 2");
  add(commandTextField, "gapright 5, r, grow");
  menu.add(showVerboseMenuItem);
  menu.add(scrollWindowMenuItem);
  SwingHelpers.traverse(this, (comp) -> comp.setComponentPopupMenu(menu));
}
origin: ron190/jsql-injection

this.chunkMenu.addActionListener(actionEvent -> {
  if (this.chunkMenu.isSelected()) {
    MediatorGui.panelConsoles().insertChunkTab();
this.binaryMenu.addActionListener(actionEvent -> {
  if (this.binaryMenu.isSelected()) {
    MediatorGui.panelConsoles().insertBooleanTab();
this.networkMenu.addActionListener(actionEvent -> {
  if (this.networkMenu.isSelected()) {
    MediatorGui.panelConsoles().insertNetworkTab();
this.javaDebugMenu.addActionListener(actionEvent -> {
  if (this.javaDebugMenu.isSelected()) {
    MediatorGui.panelConsoles().insertJavaTab();
origin: pentaho/mondrian

  getResourceConverter().getString(
    "workbench.menu.viewXML", "View XML"));
viewXmlMenuItem.addActionListener(
  new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    "workbench.menu.requireSchema", "Require Schema"));
requireSchemaCheckboxMenuItem.setSelected(requireSchema);
requireSchemaCheckboxMenuItem.addActionListener(
  new ActionListener() {
    public void actionPerformed(ActionEvent e) {
origin: magefree/mage

holdPriorityMenuItem.setToolTipText("<html>Hold priority after casting a spell or activating an ability, instead of automatically passing priority.");
popupMenu.add(holdPriorityMenuItem);
holdPriorityMenuItem.addActionListener(e -> {
  boolean holdPriority = ((JCheckBoxMenuItem) e.getSource()).getState();
  gamePanel.setMenuStates(manaPoolMenuItem1.getState(), manaPoolMenuItem2.getState(), useFirstManaAbilityItem.getState(), holdPriority);
manaPoolMenuItem1.addActionListener(e -> {
  boolean manaPoolAutomatic = ((JCheckBoxMenuItem) e.getSource()).getState();
  PreferencesDialog.saveValue(KEY_GAME_MANA_AUTOPAYMENT, manaPoolAutomatic ? "true" : "false");
manaPoolMenuItem2.addActionListener(e -> {
  boolean manaPoolAutomaticRestricted = ((JCheckBoxMenuItem) e.getSource()).getState();
  PreferencesDialog.saveValue(KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, manaPoolAutomaticRestricted ? "true" : "false");
useFirstManaAbilityItem.addActionListener(e -> {
  boolean useFirstManaAbility = ((JCheckBoxMenuItem) e.getSource()).getState();
  PreferencesDialog.saveValue(KEY_USE_FIRST_MANA_ABILITY, useFirstManaAbility ? "true" : "false");
  allowViewHandCardsMenuItem.addActionListener(e -> {
    boolean requestsAllowed = ((JCheckBoxMenuItem) e.getSource()).getState();
    PreferencesDialog.setPrefValue(KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, requestsAllowed);
origin: stackoverflow.com

 JCheckBoxMenuItem checkbox = new JCheckBoxMenuItem("Checkbox");
checkbox.addActionListener((ActionEvent e) -> {
    boolean isCheck = ((JCheckBoxMenuItem)e.getSource()).isSelected();
    if (isCheck) {
      JOptionPane.showMessageDialog(null, "You checked the checkbox", "Information", JOptionPane.INFORMATION_MESSAGE);
    }
});
origin: stackoverflow.com

 ButtonGroup buttonGroup = new ButtonGroup();
for(String s : portTab){                    
  JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem();  
  checkBoxMenuItem.setText(s);
  buttonGroup.add(checkBoxMenuItem);
  checkBoxMenuItem.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      //TODO 
    }
  });         
}
origin: igvteam/igv

private JCheckBoxMenuItem getGroupMenuItem(String label, final GroupOption option) {
  JCheckBoxMenuItem mi = new JCheckBoxMenuItem(label);
  mi.setSelected(renderOptions.getGroupByOption() == option);
  mi.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent aEvt) {
      IGV.getInstance().groupAlignmentTracks(option, null, null);
      refresh();
    }
  });
  return mi;
}
origin: igvteam/igv

private static JMenuItem getDrawBorderItem() {
  // Change track height by attribute
  final JCheckBoxMenuItem drawBorderItem = new JCheckBoxMenuItem("Draw borders");
  drawBorderItem.setSelected(FeatureTrack.isDrawBorder());
  drawBorderItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
      FeatureTrack.setDrawBorder(drawBorderItem.isSelected());
      IGV.getInstance().revalidateTrackPanels();
    }
  });
  return drawBorderItem;
}
origin: robo-code/robocode

public JCheckBoxMenuItem getOptionsShowRankingCheckBoxMenuItem() {
  if (optionsShowRankingCheckBoxMenuItem == null) {
    optionsShowRankingCheckBoxMenuItem = new JCheckBoxMenuItem();
    optionsShowRankingCheckBoxMenuItem.setText("Show current rankings");
    optionsShowRankingCheckBoxMenuItem.setMnemonic('r');
    optionsShowRankingCheckBoxMenuItem.setDisplayedMnemonicIndex(13);
    optionsShowRankingCheckBoxMenuItem.addActionListener(eventHandler);
    optionsShowRankingCheckBoxMenuItem.setEnabled(false);
  }
  return optionsShowRankingCheckBoxMenuItem;
}
origin: triplea-game/triplea

 public static void addGlobalSoundSwitchMenu(final JMenu parentMenu) {
  final JCheckBoxMenuItem soundCheckBox = new JCheckBoxMenuItem("Enable Sound");
  soundCheckBox.setMnemonic(KeyEvent.VK_N);
  soundCheckBox.setSelected(!ClipPlayer.getBeSilent());
  soundCheckBox.addActionListener(e -> ClipPlayer.setBeSilent(!soundCheckBox.isSelected()));
  parentMenu.add(soundCheckBox);
 }
}
origin: org.apache.jmeter/ApacheJMeter_core

  private static JCheckBoxMenuItem makeCheckBoxMenuItemRes(String resource,
      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;
  }
}
origin: triplea-game/triplea

private void addLockMap() {
 final JCheckBoxMenuItem lockMapBox = new JCheckBoxMenuItem("Lock Map");
 lockMapBox.setMnemonic(KeyEvent.VK_M);
 lockMapBox.setSelected(uiContext.getLockMap());
 lockMapBox.addActionListener(e -> uiContext.setLockMap(lockMapBox.isSelected()));
 add(lockMapBox);
}
javax.swingJCheckBoxMenuItemaddActionListener

Popular methods of JCheckBoxMenuItem

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

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Join (org.hibernate.mapping)
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