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

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

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

JCheckBox.isSelected介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

public void showDialog () {
  JCheckBox checkBox = new JCheckBox();
  checkBox.setSelected(currentValue);
  if (showValueDialog(checkBox, description)) value = String.valueOf(checkBox.isSelected());
}

代码示例来源:origin: wiztools/rest-client

@Override
  public void mouseClicked(MouseEvent me) {
    if(jcb_preemptive.isSelected()) {
      jcb_preemptive.setSelected(false);
    }
    else {
      jcb_preemptive.setSelected(true);
    }
  }
});

代码示例来源:origin: deathmarine/Luyten

private boolean search(String bulk) {
  String a = textField.getText();
  String b = bulk;
  if (regex.isSelected())
    return Pattern.matches(a, b);
  if (wholew.isSelected())
    a = " " + a + " ";
  if (!mcase.isSelected()) {
    a = a.toLowerCase();
    b = b.toLowerCase();
  }
  if (b.contains(a))
    return true;
  return false;
}

代码示例来源:origin: marytts/marytts

private void runActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_runActionPerformed
    return;
  boolean bestOnly = cbBestOnly.isSelected();
  boolean stereoMono = cbStereoMono.isSelected();
  int whichChannel = AudioPlayer.LEFT_ONLY;
  if (rbRight.isSelected())
    whichChannel = AudioPlayer.STEREO;
  boolean downSample = cbDownsample.isSelected();
  int targetSampleRate = Integer.parseInt((String) comboSampleRate.getSelectedItem());
  String soxPath = tfSoxPath.getText();
  if (downSample && !new File(soxPath).exists()) {
    JOptionPane.showConfirmDialog(this, "Please indicate location of 'sox' tool\n"
  boolean highPassFilter = cbHighPassFilter.isSelected();
  boolean powerNormalise = cbPowerNormalise.isSelected();
  boolean maximiseAmplitude = cbGlobalAmplitude.isSelected();
  double targetMaxAmplitude = Double.parseDouble(((String) comboMaxAmplitude.getSelectedItem()).substring(0, 3));
  boolean trimSilences = cbTrimSilences.isSelected();

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    final JCheckBox source = (JCheckBox) actionEvent.getSource();
    final Resolution resolution = ((ResolutionButtonModel) source.getModel()).getResolution();
    controller.setExportResolution(resolution, source.isSelected());
  }
};

代码示例来源:origin: libgdx/libgdx

@Override
  public void actionPerformed (ActionEvent e) {
    File file = editor.showFileLoadDialog();
    if(file != null){
      TextureParameter params = new TextureParameter();
      params.genMipMaps = genMipMaps.isSelected();
      params.minFilter = (TextureFilter)minFilterBox.getSelectedItem();
      params.magFilter = (TextureFilter)magFilterBox.getSelectedItem();
      Texture texture = editor.load(file.getAbsolutePath(), Texture.class, null, params);
      if(texture != null){
        editor.setTexture(texture);
      }
    }
  }
});

代码示例来源:origin: kiegroup/optaplanner

listFieldsPanel.add(teamListField);
listFieldsPanel.add(new JLabel("Pinned:"));
JCheckBox pinnedField = new JCheckBox("immovable during solving");
pinnedField.setSelected(teamAssignment.isPinned());
listFieldsPanel.add(pinnedField);
int result = JOptionPane.showConfirmDialog(TennisPanel.this.getRootPane(), listFieldsPanel,
    "Select team", JOptionPane.OK_CANCEL_OPTION);
if (result == JOptionPane.OK_OPTION) {
  Team toTeam = (Team) teamListField.getSelectedItem();
  if (teamAssignment.getTeam() != toTeam) {
    solutionBusiness.doChangeMove(teamAssignment, "team", toTeam);
  boolean toPinned = pinnedField.isSelected();
  if (teamAssignment.isPinned() != toPinned) {
    if (solutionBusiness.isSolving()) {

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

labelIsTamperingBase64.setToolTipText(tooltipIsTamperingBase64);
labelIsTamperingBase64.addActionListener(actionEvent -> {
  this.checkboxIsTamperingBase64.setSelected(!this.checkboxIsTamperingBase64.isSelected());
  this.actionListenerSave.actionPerformed(null);
});
labelIsTamperingFunctionComment.setToolTipText(tooltipIsTamperingFunctionComment);
labelIsTamperingFunctionComment.addActionListener(actionEvent -> {
  this.checkboxIsTamperingFunctionComment.setSelected(!this.checkboxIsTamperingFunctionComment.isSelected());
  this.actionListenerSave.actionPerformed(null);
});
labelIsTamperingEqualToLike.setToolTipText(tooltipIsTamperingEqualToLike);
labelIsTamperingEqualToLike.addActionListener(actionEvent -> {
  this.checkboxIsTamperingEqualToLike.setSelected(!this.checkboxIsTamperingEqualToLike.isSelected());
  this.actionListenerSave.actionPerformed(null);
});
labelIsTamperingRandomCase.setToolTipText(tooltipIsTamperingRandomCase);
labelIsTamperingRandomCase.addActionListener(actionEvent -> {
  this.checkboxIsTamperingRandomCase.setSelected(!this.checkboxIsTamperingRandomCase.isSelected());
  this.actionListenerSave.actionPerformed(null);
});
labelIsTamperingVersionComment.setToolTipText(tooltipIsTamperingVersionComment);
labelIsTamperingVersionComment.addActionListener(actionEvent -> {
  this.checkboxIsTamperingVersionComment.setSelected(!this.checkboxIsTamperingVersionComment.isSelected());
  this.actionListenerSave.actionPerformed(null);
});

代码示例来源:origin: runelite/runelite

bottomPanel.add(refreshWidgetsBtn);
alwaysOnTop = new JCheckBox("Always on top");
alwaysOnTop.addItemListener(ev -> config.inspectorAlwaysOnTop(alwaysOnTop.isSelected()));
onConfigChanged(null);
bottomPanel.add(alwaysOnTop);

代码示例来源:origin: nodebox/nodebox

public void actionPerformed(ActionEvent e) {
  Port port = getPort();
  if (e.getSource() == labelField) {
    if (labelField.getText().equals(port.getDisplayLabel())) return;
    nodeAttributesDialog.setPortLabel(portName, labelField.getText());
  } else if (e.getSource() == descriptionField) {
    nodeAttributesDialog.setPortDescription(portName, descriptionField.getText());
  } else if (e.getSource() == widgetBox) {
    HumanizedObject newWidget = (HumanizedObject) widgetBox.getSelectedItem();
    if (port.getWidget() == newWidget.getObject()) return;
    nodeAttributesDialog.setPortWidget(portName, (Port.Widget) newWidget.getObject());
  } else if (e.getSource() == rangeBox) {
    HumanizedObject newRange = (HumanizedObject) rangeBox.getSelectedItem();
    if (port.getRange() == newRange.getObject()) return;
    nodeAttributesDialog.setPortRange(portName, (Port.Range) newRange.getObject());
  } else if (e.getSource() == minimumValueCheck) {
    if (minimumValueCheck.isSelected() && port.getMinimumValue() != null) return;
    nodeAttributesDialog.setPortMinimumValue(portName, minimumValueCheck.isSelected() ? (double) 0f : null);
  } else if (e.getSource() == minimumValueField) {
    try {
  } else if (e.getSource() == maximumValueCheck) {
    if (maximumValueCheck.isSelected() && port.getMaximumValue() != null) return;
    nodeAttributesDialog.setPortMaximumValue(portName, maximumValueCheck.isSelected() ? (double) 0f : null);
  } else if (e.getSource() == maximumValueField) {
    try {

代码示例来源:origin: RipMeApp/ripme

});
configLogLevelCombobox.addActionListener(arg0 -> {
  String level = ((JComboBox) arg0.getSource()).getSelectedItem().toString();
  setLogLevel(level);
});
configSelectLangComboBox.addActionListener(arg0 -> {
  String level = ((JComboBox) arg0.getSource()).getSelectedItem().toString();
  rb = Utils.getResourceBundle(level);
  changeLocale();
  Utils.setConfigBoolean("clipboard.autorip", configClipboardAutorip.isSelected());
  ClipboardUtils.setClipboardAutoRip(configClipboardAutorip.isSelected());
  trayMenuAutorip.setState(configClipboardAutorip.isSelected());
  Utils.configureLogger();
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-railsprojects

private void initWithDispatchersCheckBox() {
  boolean enable = false;
  String selected = (String) railsVersionComboBox.getSelectedItem();
  if (selected != null) {
    RailsVersion version23 = new RailsVersion(2, 3);
    enable = RailsProjectUtil.versionFor(selected).compareTo(version23) >= 0;
  }
  withDispatchersCheckBox.setSelected(withDispatchersCheckBox.isSelected() && enable);
  withDispatchersCheckBox.setEnabled(enable);
}

代码示例来源:origin: marytts/marytts

private void runActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_runActionPerformed
    return;
  boolean bestOnly = cbBestOnly.isSelected();
  boolean stereoMono = cbStereoMono.isSelected();
  int whichChannel = AudioPlayer.LEFT_ONLY;
  if (rbRight.isSelected())
    whichChannel = AudioPlayer.STEREO;
  boolean downSample = cbDownsample.isSelected();
  int targetSampleRate = Integer.parseInt((String) comboSampleRate.getSelectedItem());
  String soxPath = tfSoxPath.getText();
  if (downSample && !new File(soxPath).exists()) {
    JOptionPane.showConfirmDialog(this, "Please indicate location of 'sox' tool\n"
  boolean highPassFilter = cbHighPassFilter.isSelected();
  boolean powerNormalise = cbPowerNormalise.isSelected();
  boolean maximiseAmplitude = cbGlobalAmplitude.isSelected();
  double targetMaxAmplitude = Double.parseDouble(((String) comboMaxAmplitude.getSelectedItem()).substring(0, 3));
  boolean trimSilences = cbTrimSilences.isSelected();

代码示例来源:origin: bonnyfone/vectalign

private boolean export(){
  lastSupportVectorCompat = checkVectorCompat.isSelected();
  lastDuration = txtDuration.getText();
  if(lastOuputDir != null){
    //Chose prefix
    String defaultPrefix = "vectalign";
    String prefix = txtPrefix.getText();
    if(prefix == null || prefix.trim().equals("")){
      prefix = "";
    }
    lastPrefix = prefix.toLowerCase();
    //Export
    boolean success = AnimatedVectorDrawableUtils.export(lastOuputDir, lastDuration, lastSupportVectorCompat,
        lastPrefix, solution, stroke, fill, strokeColor, strokeWidth, fillColor,
        DEFAULT_EXPORT_SIZE, DEFAULT_EXPORT_SIZE, viewPortWidth, viewPortHeight);
    if(success)
      JOptionPane.showMessageDialog(VectAlignExportDialog.this, "Export completed ("+lastOuputDir.getAbsolutePath() +")", "VectAlign Export", JOptionPane.INFORMATION_MESSAGE);
    else
      JOptionPane.showMessageDialog(VectAlignExportDialog.this, "Unable to export files to "+lastOuputDir.getAbsolutePath() , "VectAlign Export", JOptionPane.ERROR_MESSAGE);
    return success;
  }
  else
    JOptionPane.showMessageDialog(VectAlignExportDialog.this, "Specify a valid ouput directory." , "VectAlign Export", JOptionPane.ERROR_MESSAGE);
  return false;
}

代码示例来源:origin: libgdx/libgdx

public void showDialog () {
  JCheckBox checkBox = new JCheckBox();
  checkBox.setSelected(currentValue);
  if (showValueDialog(checkBox, description)) value = String.valueOf(checkBox.isSelected());
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

@Override
  public void actionPerformed(ActionEvent actionEvent) {
    final JCheckBox source = (JCheckBox) actionEvent.getSource();
    final Resolution resolution = ((ResolutionButtonModel) source.getModel()).getResolution();
    if (source.isSelected()) {
      controller.addTargetResolution(resolution);
    } else {
      controller.removeTargetResolution(resolution);
    }
  }
};

代码示例来源:origin: libgdx/libgdx

@Override
  public void actionPerformed (ActionEvent e) {
    File file = editor.showFileLoadDialog();
    if(file != null){
      TextureParameter params = new TextureParameter();
      params.genMipMaps = genMipMaps.isSelected();
      params.minFilter = (TextureFilter)minFilterBox.getSelectedItem();
      params.magFilter = (TextureFilter)magFilterBox.getSelectedItem();
      Texture texture = editor.load(file.getAbsolutePath(), Texture.class, null, params);
      if(texture != null){
        editor.setTexture(texture);
      }
    }
  }
});

代码示例来源:origin: stanfordnlp/CoreNLP

public void setActive(boolean active) {
 if(check != null && (check.isSelected() != active)) {
  check.setSelected(active);
  sendToListeners();
 }
}

代码示例来源:origin: kiegroup/optaplanner

listFieldsPanel.add(roomListField);
listFieldsPanel.add(new JLabel("Pinned:"));
JCheckBox pinnedField = new JCheckBox("immovable during solving");
pinnedField.setSelected(lecture.isPinned());
listFieldsPanel.add(pinnedField);
int result = JOptionPane.showConfirmDialog(CurriculumCoursePanel.this.getRootPane(), listFieldsPanel,
    "Select period and room", JOptionPane.OK_CANCEL_OPTION);
if (result == JOptionPane.OK_OPTION) {
  Period toPeriod = (Period) periodListField.getSelectedItem();
  if (lecture.getPeriod() != toPeriod) {
    solutionBusiness.doChangeMove(lecture, "period", toPeriod);
  Room toRoom = (Room) roomListField.getSelectedItem();
  if (lecture.getRoom() != toRoom) {
    solutionBusiness.doChangeMove(lecture, "room", toRoom);
  boolean toPinned = pinnedField.isSelected();
  if (lecture.isPinned() != toPinned) {
    if (solutionBusiness.isSolving()) {

代码示例来源:origin: edu.toronto.cs.savant/savant-core

@Override
  public void actionPerformed(ActionEvent ae) {
    JCheckBox sender = (JCheckBox)ae.getSource();
    for (JCheckBox dep: dependents) {
      dep.setSelected(sender.isSelected());
    }
  }
}

相关文章

JCheckBox类方法