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

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

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

JCheckBox.setSelected介绍

暂无

代码示例

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

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

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

contentPanel.add(new JLabel("XYZ:"), new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
    new Insets(6, 0, 0, 0), 0, 0));
drawXYZCheckBox = new JCheckBox();
contentPanel.add(drawXYZCheckBox, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
    GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
contentPanel.add(new JLabel("XZ Plane:"), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
    new Insets(6, 0, 0, 0), 0, 0));
drawXZPlaneBox = new JCheckBox();
contentPanel.add(drawXZPlaneBox, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.WEST,
    GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
contentPanel.add(new JLabel("XY Plane:"), new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
    new Insets(6, 0, 0, 0), 0, 0));
drawXYPlaneBox = new JCheckBox();
contentPanel.add(drawXYPlaneBox, new GridBagConstraints(1, 3, 1, 1, 1, 0, GridBagConstraints.WEST,
    GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
drawXYZCheckBox.setSelected(editor.getRenderer().IsDrawXYZ());
drawXZPlaneBox.setSelected(editor.getRenderer().IsDrawXZPlane());

代码示例来源:origin: skylot/jadx

private SettingsGroup makeDecompilationGroup() {
  JCheckBox fallback = new JCheckBox();
  fallback.setSelected(settings.isFallbackMode());
  fallback.addItemListener(e -> {
    settings.setFallbackMode(e.getStateChange() == ItemEvent.SELECTED);
  JCheckBox showInconsistentCode = new JCheckBox();
  showInconsistentCode.setSelected(settings.isShowInconsistentCode());
  showInconsistentCode.addItemListener(e -> {
    settings.setShowInconsistentCode(e.getStateChange() == ItemEvent.SELECTED);
  JCheckBox resourceDecode = new JCheckBox();
  resourceDecode.setSelected(settings.isSkipResources());
  resourceDecode.addItemListener(e -> {
    settings.setSkipResources(e.getStateChange() == ItemEvent.SELECTED);
  autoStartJobs.setSelected(settings.isAutoStartJobs());
  autoStartJobs.addItemListener(e -> settings.setAutoStartJobs(e.getStateChange() == ItemEvent.SELECTED));
  escapeUnicode.setSelected(settings.escapeUnicode());
  escapeUnicode.addItemListener(e -> {
    settings.setEscapeUnicode(e.getStateChange() == ItemEvent.SELECTED);
  replaceConsts.setSelected(settings.isReplaceConsts());
  replaceConsts.addItemListener(e -> {
    settings.setReplaceConsts(e.getStateChange() == ItemEvent.SELECTED);
  useImports.setSelected(settings.isUseImports());
  useImports.addItemListener(e -> {
    settings.setUseImports(e.getStateChange() == ItemEvent.SELECTED);

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

setSize(d);
deviceNameLabel = new JLabel(deviceHandler.getName());
portNumberField = new JTextField();
portNumberField.setText(String.valueOf(getPort()));
portNumberField.setMinimumSize(new Dimension(70, portNumberField.getHeight()));
syncWithTimelineCheck = new JCheckBox("Sync with Timeline");
syncWithTimelineCheck.setSelected(isSyncedWithTimeline());
syncWithTimelineCheck.addItemListener(new ItemListener() {
  @Override
  startButton.setText("Start");
startButton.addActionListener(new ActionListener() {
  @Override
  public void actionPerformed(ActionEvent actionEvent) {
stopButton.addActionListener(new ActionListener() {
  @Override
  public void actionPerformed(ActionEvent actionEvent) {
stopButton.setEnabled(oscP5 != null);
clearButton = new JButton("Clear");
clearButton.addActionListener(new ActionListener() {
  @Override
  public void actionPerformed(ActionEvent actionEvent) {

代码示例来源:origin: sc.fiji/VIB-lib

public static JCheckBox addCheckBox(Container c, String label) {
  JCheckBox check = new JCheckBox();
  check.setSelected(false);
  Box box = new Box(BoxLayout.X_AXIS);
  box.add(new JLabel(label));
  box.add(Box.createGlue());
  box.add(check);
  c.add(box);
  return check;
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

this.tableView.setModelAndUpdateColumns(this.modelList);
tableViewPanel.add(ToolbarDecorator.createDecorator(this.tableView)
  .disableAddAction()
  .disableDownAction()
this.generateButton.addActionListener(e -> update());
this.checkBoxSymfonyIdClass.setSelected(Settings.getInstance(project).serviceClassAsIdAttribute);
this.checkBoxSymfonyIdClass.addItemListener(e -> {
  Settings.getInstance(project).serviceClassAsIdAttribute = checkBoxSymfonyIdClass.isSelected();
});
this.closeButton.addActionListener(e -> {
  setEnabled(false);
  dispose();
});
this.buttonCopy.addActionListener(e -> {
  if(StringUtils.isBlank(textAreaOutput.getText())) {
    return;

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

this.jogPanelPanel.setLayout(new BorderLayout());
this.jogPanelPanel.add(jogPanel, BorderLayout.CENTER);
initProgram();
backend.addControllerListener(this);
commPortComboBox.setSelectedItem(settings.getPort());
baudrateSelectionComboBox.setSelectedItem(settings.getPortRate());
scrollWindowCheckBox.setSelected(settings.isScrollWindowEnabled());
checkScrollWindow();
showVerboseOutputCheckBox.setSelected(settings.isVerboseOutputEnabled());
showCommandTableCheckBox.setSelected(settings.isCommandTableEnabled());
firmwareComboBox.setSelectedItem(settings.getFirmwareVersion());

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

contentPanel.add(new JLabel("XYZ:"), new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
    new Insets(6, 0, 0, 0), 0, 0));
drawXYZCheckBox = new JCheckBox();
contentPanel.add(drawXYZCheckBox, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
    GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
contentPanel.add(new JLabel("XZ Plane:"), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
    new Insets(6, 0, 0, 0), 0, 0));
drawXZPlaneBox = new JCheckBox();
contentPanel.add(drawXZPlaneBox, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.WEST,
    GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
contentPanel.add(new JLabel("XY Plane:"), new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
    new Insets(6, 0, 0, 0), 0, 0));
drawXYPlaneBox = new JCheckBox();
contentPanel.add(drawXYPlaneBox, new GridBagConstraints(1, 3, 1, 1, 1, 0, GridBagConstraints.WEST,
    GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
drawXYZCheckBox.setSelected(editor.getRenderer().IsDrawXYZ());
drawXZPlaneBox.setSelected(editor.getRenderer().IsDrawXZPlane());

代码示例来源:origin: Killerardvark/CryodexSource

public PlayerPanel(Player player) {
  this.player = player;
  playerNameLabel = new JLabel(player.getName());
  checkbox = new JCheckBox();
  checkbox.setSelected(player.isActive());
  checkbox.addActionListener(new ActionListener() {
    
    @Override
    public void actionPerformed(ActionEvent e) {
      updateActivePlayerCount();
    }
  });
}

代码示例来源:origin: Exslims/MercuryTrade

@Override
public void onViewInit() {
  this.setLayout(new BorderLayout());
  this.setBackground(AppThemeColor.FRAME);
  JButton hideButton = componentsFactory.getIconButton("app/close.png", 12, AppThemeColor.FRAME, "Dismiss");
  hideButton.addActionListener((action) -> {
    stashTabDescriptor.setUndefined(true);
    MercuryStoreUI.dismissTabInfoPanelSubject.onNext(this);
  });
  JPanel tabInfoPanel = componentsFactory.getJPanel(new FlowLayout(FlowLayout.CENTER));
  JLabel tabLabel = componentsFactory.getTextLabel(stashTabDescriptor.getTitle());
  tabLabel.setBorder(null);
  tabLabel.setFont(componentsFactory.getFont(FontStyle.BOLD, 15f));
  tabInfoPanel.add(tabLabel);
  JCheckBox isItQuad = componentsFactory.getCheckBox("Is it Quad?");
  isItQuad.setSelected(stashTabDescriptor.isQuad());
  isItQuad.setPreferredSize(new Dimension(16, 16));
  isItQuad.addActionListener(action -> {
    stashTabDescriptor.setQuad(isItQuad.isSelected());
  });
  tabInfoPanel.add(isItQuad);
  tabInfoPanel.add(hideButton);
  this.add(tabInfoPanel, BorderLayout.PAGE_END);
  this.setBorder(BorderFactory.createLineBorder(AppThemeColor.BORDER, 1));
}

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

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

代码示例来源: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: jMonkeyEngine/jmonkeyengine

private JPanel createSearchPanel(final FilteredJList classes) {
  JPanel search = new JPanel();
  search.setLayout(new BorderLayout());
  search.add(new JLabel("Choose a Demo to start:      Find: "),
      BorderLayout.WEST);
  final javax.swing.JTextField jtf = new javax.swing.JTextField();
  final JCheckBox showSettingCheck = new JCheckBox("Show Setting");
  showSettingCheck.setSelected(true);
  showSettingCheck.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
  search.add(jtf, BorderLayout.CENTER);
  search.add(showSettingCheck, BorderLayout.EAST);
  return search;

代码示例来源:origin: Audiveris/audiveris

TopicPane (Topic topic)
{
  this.topic = topic;
  PanelBuilder builder = new PanelBuilder(layout3, this);
  CellConstraints cst = new CellConstraints();
  JCheckBox box = new JCheckBox();
  box.addActionListener(this);
  box.setSelected(topic.isSet());
  final int r = 1;
  builder.add(box, cst.xy(1, r));
  builder.add(new JLabel(topic.name()), cst.xy(3, r));
  builder.add(new JLabel(topic.getDescription()), cst.xy(5, r));
}

代码示例来源:origin: skylot/jadx

private JCheckBox makeOptionsCheckBox(String name, final SearchOptions opt) {
  final JCheckBox chBox = new JCheckBox(name);
  chBox.setAlignmentX(LEFT_ALIGNMENT);
  chBox.setSelected(options.contains(opt));
  chBox.addItemListener(e -> {
    if (chBox.isSelected()) {
      options.add(opt);
    } else {
      options.remove(opt);
    }
    searchEmitter.emitSearch();
  });
  return chBox;
}

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

useGPUBox = new JCheckBox();
useGPUBox.setSelected(renderer.isUseGPU());
useGPUBox.addChangeListener(new ChangeListener() {
  public void stateChanged (ChangeEvent event) {
contentPanel.add(new JLabel("Align"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(alignCombo, new GridBagConstraints(1, i++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(new JLabel("Use GPU"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(useGPUBox, new GridBagConstraints(1, i++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(new JLabel("Sort"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(sortCombo, new GridBagConstraints(1, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,

代码示例来源:origin: skylot/jadx

JCheckBox update = new JCheckBox();
update.setSelected(settings.isCheckForUpdates());
update.addItemListener(e -> settings.setCheckForUpdates(e.getStateChange() == ItemEvent.SELECTED));
JCheckBox cfg = new JCheckBox();
cfg.setSelected(settings.isCfgOutput());
cfg.addItemListener(e -> {
  settings.setCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
});
JCheckBox rawCfg = new JCheckBox();
rawCfg.setSelected(settings.isRawCfgOutput());
rawCfg.addItemListener(e -> {
  settings.setRawCfgOutput(e.getStateChange() == ItemEvent.SELECTED);

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

useGPUBox = new JCheckBox();
useGPUBox.setSelected(renderer.isUseGPU());
useGPUBox.addChangeListener(new ChangeListener() {
  public void stateChanged (ChangeEvent event) {
contentPanel.add(new JLabel("Align"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(alignCombo, new GridBagConstraints(1, i++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(new JLabel("Use GPU"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(useGPUBox, new GridBagConstraints(1, i++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(new JLabel("Sort"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  new Insets(6, 0, 0, 0), 0, 0));
contentPanel.add(sortCombo, new GridBagConstraints(1, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,

代码示例来源:origin: skylot/jadx

private SettingsGroup makeDeobfuscationGroup() {
  JCheckBox deobfOn = new JCheckBox();
  deobfOn.setSelected(settings.isDeobfuscationOn());
  deobfOn.addItemListener(e -> {
    settings.setDeobfuscationOn(e.getStateChange() == ItemEvent.SELECTED);
  });
  JCheckBox deobfForce = new JCheckBox();
  deobfForce.setSelected(settings.isDeobfuscationForceSave());
  deobfForce.addItemListener(e -> {
    settings.setDeobfuscationForceSave(e.getStateChange() == ItemEvent.SELECTED);
  });
  JCheckBox deobfSourceAlias = new JCheckBox();
  deobfSourceAlias.setSelected(settings.isDeobfuscationUseSourceNameAsAlias());
  deobfSourceAlias.addItemListener(e -> {
    settings.setDeobfuscationUseSourceNameAsAlias(e.getStateChange() == ItemEvent.SELECTED);

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

protected JPanel createControls() {
    JPanel controls = new JPanel();
    JCheckBox checkPhasogram = new JCheckBox("Show phasogram");
    checkPhasogram.setAlignmentX(CENTER_ALIGNMENT);
    checkPhasogram.setSelected(show);
    checkPhasogram.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.DESELECTED) {
          show = false;
          if (graph != null)
            graph.getTopLevelAncestor().setVisible(false);
        } else if (e.getStateChange() == ItemEvent.SELECTED) {
          show = true;
          update(positionCursor.x);
          if (graph != null)
            graph.getTopLevelAncestor().setVisible(true);
        }
      }
    });
    controls.add(checkPhasogram);
    return controls;
  }
}

相关文章

JCheckBox类方法