javax.swing.JCheckBox.setEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(12.1k)|赞(0)|评价(0)|浏览(226)

本文整理了Java中javax.swing.JCheckBox.setEnabled()方法的一些代码示例,展示了JCheckBox.setEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JCheckBox.setEnabled()方法的具体详情如下:
包路径:javax.swing.JCheckBox
类名称:JCheckBox
方法名:setEnabled

JCheckBox.setEnabled介绍

暂无

代码示例

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    annotationFT.setText("@{filed}");
    annotationFT.setEnabled(otherRB.isSelected());
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (fastJsonRB.isSelected()) {
      annotationFT.setText(Constant.fastAnnotation);
    }
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    annotationFT.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (loganSquareCB.isSelected()) {
      annotationFT.setText(Constant.loganSquareAnnotation);
    }
    annotationFT.setEnabled(otherRB.isSelected());
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (lombokRB.isSelected()) {
      annotationFT.setText(Constant.lombokAnnotation);
    }
    annotationFT.setEnabled(otherRB.isSelected());
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: zzz40500/GsonFormat

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    if (jackRB.isSelected()) {
      annotationFT.setText(Constant.jackAnnotation);
    }
    annotationFT.setEnabled(false);
    objectFromDataCB.setEnabled(false);
    objectFromData1CB.setEnabled(false);
    arrayFromDataCB.setEnabled(false);
    arrayFromData1CB.setEnabled(false);
    annotationFT.setEnabled(false);
    objectFromDataCB.setSelected(false);
    objectFromData1CB.setSelected(false);
    arrayFromDataCB.setSelected(false);
    arrayFromData1CB.setSelected(false);
    objectButton.setEnabled(false);
    object1Button.setEnabled(false);
    arrayButton.setEnabled(false);
    array1Button.setEnabled(false);
  }
});

代码示例来源:origin: chewiebug/GCViewer

/**
 * OpenUrlView shows a checkbox to let the user choose "add selected URL to 
 * current document".
 * 
 * @param showCheckBox <code>true</code>: checkbox is shown, otherwise it is hidden.
 */
public void setShowAddCheckBox(boolean showCheckBox) {
  
  addUrlCheckBox.setVisible(showCheckBox);
  addUrlCheckBox.setEnabled(showCheckBox);
  if (!showCheckBox) {
    // Checkbox must never be selected, when it is not visible.
    // Can happen if last file was added and whole document is closed afterwards.
    // -> State of checkbox still "selected" but not visible any more.
    addUrlCheckBox.setSelected(false);
  }
}

代码示例来源:origin: chewiebug/GCViewer

/**
   * OpenFileView shows an accessory checkbox to let the user choose "add selected file(s) to 
   * current document".
   * 
   * @param showCheckBox <code>true</code>: checkbox is shown, otherwise it is hidden.
   */
  public void setShowAddCheckBox(boolean showCheckBox) {
    addFileCheckBox.setVisible(showCheckBox);
    addFileCheckBox.setEnabled(showCheckBox);
    if (!showCheckBox) {
      // Checkbox must never be selected, when it is not visible.
      // Can happen if last file was added and whole document is closed afterwards.
      // -> State of checkbox still "selected" but not visible any more.
      addFileCheckBox.setSelected(false);
    }
  }
}

代码示例来源:origin: magefree/mage

public void switchToGrid() {
  jToggleListView.setSelected(false);
  jToggleCardView.setSelected(true);
  currentView = cardGrid;
  cardSelectorScrollPane.setViewportView(cardGrid);
  cbSortBy.setEnabled(true);
  chkPiles.setEnabled(true);
  jButtonAddToMain.setEnabled(false);
  jButtonAddToSideboard.setEnabled(false);
  filterCards();
  chkPiles.setSelected(true);
  this.currentView.drawCards(sortSetting);
}

代码示例来源:origin: magefree/mage

private void useSelectedOrRandom() {
  cbUseRandomBattleImage.setEnabled(true);
  String temp = CACHE.get(KEY_BATTLEFIELD_IMAGE_RANDOM);
  if (temp != null) {
    if (temp.equals("true")) {
      useRandomBattleField();
      cbUseRandomBattleImage.setSelected(true);
    } else {
      useSelectedBattleField();
      cbUseRandomBattleImage.setSelected(false);
    }
  } else {
    useSelectedBattleField();
    cbUseRandomBattleImage.setSelected(false);
  }
}

代码示例来源:origin: magefree/mage

mainTable.setOpaque(false);
cbSortBy.setEnabled(false);
chkPiles.setEnabled(false);
chkNames.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_NAMES, "true")));
chkTypes.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_TYPES, "true")));
chkRules.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_RULES, "true")));
chkUnique.setSelected("true".equals(MageFrame.getPreferences().get(KEY_DECK_EDITOR_SEARCH_UNIQUE, "false")));

代码示例来源:origin: winder/Universal-G-Code-Sender

public ProcessorConfigCheckbox(ProcessorConfig pc, String helpMessage) {
  this.pc = pc;
  if (helpMessage == null)
    throw new RuntimeException("Help message was not provided.");
  JButton help = new JButton("?");
  help.addActionListener((ActionEvent e) -> {
    GUIHelpers.displayHelpDialog(helpMessage);
  });
  add(help, "w 25");
  box = new JCheckBox(Localization.getString(pc.name));
  box.setSelected(pc.enabled);
  box.addActionListener((ActionEvent e) -> {
      pc.enabled = box.isSelected();
    });
  if (!pc.optional) {
    box.setEnabled(false);
  }
  JButton edit = new JButton("edit");
  edit.addActionListener(evt -> editArgs());
  setLayout(new MigLayout("insets 0 50 0 0", "[][grow]20[]25"));
  add(box, "growx");
  if (pc.args != null) {
    add(edit, "w 45");
  }
}

代码示例来源:origin: vulnersCom/burp-vulners-scanner

panel3.add(spacer2, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
cbxSoftwareShowVuln = new JCheckBox();
cbxSoftwareShowVuln.setSelected(false);
cbxSoftwareShowVuln.setText("Show only vulnerable software");
panel3.add(cbxSoftwareShowVuln, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel4.add(label8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
cbxPathSearch = new JCheckBox();
cbxPathSearch.setEnabled(true);
cbxPathSearch.setSelected(false);
cbxPathSearch.setText("");
panel4.add(cbxPathSearch, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(51, 20), null, 0, false));
panel4.add(label13, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
cbxProxyEnabled = new JCheckBox();
cbxProxyEnabled.setEnabled(true);
cbxProxyEnabled.setSelected(false);
cbxProxyEnabled.setText("");
panel4.add(cbxProxyEnabled, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
panel4.add(label14, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
cbxPathScanInScope = new JCheckBox();
cbxPathScanInScope.setEnabled(true);
cbxPathScanInScope.setSelected(true);
cbxPathScanInScope.setText("");

代码示例来源:origin: ron190/jsql-injection

labelIsTamperingBase64.setToolTipText(tooltipIsTamperingBase64);
labelIsTamperingBase64.addActionListener(actionEvent -> {
  this.checkboxIsTamperingBase64.setSelected(!this.checkboxIsTamperingBase64.isSelected());
  this.actionListenerSave.actionPerformed(null);
});
    this.checkboxProcessCookies.setSelected(this.checkboxProcessCsrf.isSelected());
  this.checkboxProcessCookies.setEnabled(!this.checkboxProcessCsrf.isSelected());
  labelProcessCookies.setEnabled(!this.checkboxProcessCsrf.isSelected());
};
this.checkboxProcessCookies.setEnabled(!this.checkboxProcessCsrf.isSelected());
labelProcessCookies.setEnabled(!this.checkboxProcessCsrf.isSelected());
  this.checkboxIsCheckingAllHeaderParam.setSelected(this.checkboxIsCheckingAllParam.isSelected());
  this.checkboxIsCheckingAllURLParam.setEnabled(!this.checkboxIsCheckingAllParam.isSelected());
  this.checkboxIsCheckingAllRequestParam.setEnabled(!this.checkboxIsCheckingAllParam.isSelected());
  this.checkboxIsCheckingAllHeaderParam.setEnabled(!this.checkboxIsCheckingAllParam.isSelected());
};
this.checkboxIsCheckingAllURLParam.setEnabled(!this.checkboxIsCheckingAllParam.isSelected());
this.checkboxIsCheckingAllRequestParam.setEnabled(!this.checkboxIsCheckingAllParam.isSelected());
this.checkboxIsCheckingAllHeaderParam.setEnabled(!this.checkboxIsCheckingAllParam.isSelected());

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void stateChanged(ChangeEvent evt) {
    if (jcbEncrypt.isSelected()) {
      jcbExportPem.setSelected(true);
      jcbExportPem.setEnabled(false);
    } else {
      jcbExportPem.setEnabled(true);
    }
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void itemStateChanged(ItemEvent evt) {
    if (jrbExportSpc.isSelected()) {
      jcbExportPem.setEnabled(false);
      jcbExportPem.setSelected(false);
      updateFileExtension(FileChooserFactory.SPC_EXT);
    } else {
      jcbExportPem.setEnabled(true);
    }
  }
});

代码示例来源:origin: kaikramer/keystore-explorer

@Override
  public void itemStateChanged(ItemEvent evt) {
    if (jrbExportPkiPath.isSelected()) {
      jcbExportPem.setEnabled(false);
      jcbExportPem.setSelected(false);
      updateFileExtension(FileChooserFactory.PKI_PATH_EXT);
    } else {
      jcbExportPem.setEnabled(true);
    }
  }
});

代码示例来源:origin: jawi/ols

/**
 * Updates the enabled state of the given checkbox. If <em>not</em> enabled,
 * it will also deselect the given checkbox.
 */
static void updateCheckBoxState( final JCheckBox aCheckBox, final boolean aEnabled )
{
 if ( !aEnabled )
 {
  aCheckBox.setSelected( false );
 }
 aCheckBox.setEnabled( aEnabled );
}

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Toggles whether the "Offer filename suggestions" checkbox is selected.
 *
 * @param selected Whether it should be selected.
 */
private void setOfferSuggestionsSelected(boolean selected) {
  offerSuggestionsCB.setSelected(selected);
  autoCompleteCheckBox.setEnabled(selected);
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/sqlscript

private void onQualifyTableNamesCheckBox()
{
 if(qualifyTableNamesCheckBox.isSelected())
 {
   useDoubleQuotesCheckBox.setEnabled(true);
 }
 else
 {
   useDoubleQuotesCheckBox.setSelected(false);
   useDoubleQuotesCheckBox.setEnabled(false);
 }
}

代码示例来源:origin: RPTools/maptool

public void itemStateChanged(ItemEvent e) {
    if (!playersCanRevealVision.isSelected()) {
      autoRevealOnMovement.setSelected(false);
      autoRevealOnMovement.setEnabled(false);
    } else {
      autoRevealOnMovement.setEnabled(true);
    }
  }
});

相关文章

JCheckBox类方法