本文整理了Java中javax.swing.JCheckBox.addItemListener()
方法的一些代码示例,展示了JCheckBox.addItemListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JCheckBox.addItemListener()
方法的具体详情如下:
包路径:javax.swing.JCheckBox
类名称:JCheckBox
方法名:addItemListener
暂无
代码示例来源: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: 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;
}
}
代码示例来源: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;
}
}
代码示例来源:origin: marytts/marytts
protected JPanel createControls() {
JPanel controls = new JPanel();
JCheckBox checkSpectrum = new JCheckBox("Show spectrum");
checkSpectrum.setAlignmentX(CENTER_ALIGNMENT);
checkSpectrum.setSelected(show);
checkSpectrum.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(checkSpectrum);
return controls;
}
}
代码示例来源:origin: marytts/marytts
protected JPanel createControls() {
JPanel controls = new JPanel();
JCheckBox checkSpectrum = new JCheckBox("Show spectrum");
checkSpectrum.setAlignmentX(CENTER_ALIGNMENT);
checkSpectrum.setSelected(show);
checkSpectrum.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(checkSpectrum);
return controls;
}
}
代码示例来源:origin: skylot/jadx
update.addItemListener(e -> settings.setCheckForUpdates(e.getStateChange() == ItemEvent.SELECTED));
cfg.addItemListener(e -> {
settings.setCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
needReload();
rawCfg.addItemListener(e -> {
settings.setRawCfgOutput(e.getStateChange() == ItemEvent.SELECTED);
needReload();
代码示例来源:origin: marytts/marytts
checkCepstrum.setAlignmentX(CENTER_ALIGNMENT);
checkCepstrum.setSelected(show);
checkCepstrum.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
代码示例来源:origin: marytts/marytts
checkCepstrum.setAlignmentX(CENTER_ALIGNMENT);
checkCepstrum.setSelected(show);
checkCepstrum.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
代码示例来源:origin: marytts/marytts
checkLPC.setAlignmentX(CENTER_ALIGNMENT);
checkLPC.setSelected(show);
checkLPC.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
代码示例来源:origin: marytts/marytts
checkLPC.setAlignmentX(CENTER_ALIGNMENT);
checkLPC.setSelected(show);
checkLPC.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
代码示例来源:origin: opentripplanner/OpenTripPlanner
showTransitCheckbox = new JCheckBox("show transit");
showTransitCheckbox.setSelected(true);
showTransitCheckbox.addItemListener(onChangeVizPrefs);
pane.add(showTransitCheckbox);
showStreetsCheckbox = new JCheckBox("show streets");
showStreetsCheckbox.setSelected(true);
showStreetsCheckbox.addItemListener(onChangeVizPrefs);
pane.add(showStreetsCheckbox);
showHighlightedCheckbox = new JCheckBox("show highlighted");
showHighlightedCheckbox.setSelected(true);
showHighlightedCheckbox.addItemListener(onChangeVizPrefs);
pane.add(showHighlightedCheckbox);
showSPTCheckbox = new JCheckBox("show SPT");
showSPTCheckbox.setSelected(true);
showSPTCheckbox.addItemListener(onChangeVizPrefs);
pane.add(showSPTCheckbox);
showMultistateVerticesCheckbox = new JCheckBox("show multistate vertices");
showMultistateVerticesCheckbox.setSelected(true);
showMultistateVerticesCheckbox.addItemListener(onChangeVizPrefs);
pane.add(showMultistateVerticesCheckbox);
代码示例来源:origin: skylot/jadx
private SettingsGroup makeDeobfuscationGroup() {
JCheckBox deobfOn = new JCheckBox();
deobfOn.setSelected(settings.isDeobfuscationOn());
deobfOn.addItemListener(e -> {
settings.setDeobfuscationOn(e.getStateChange() == ItemEvent.SELECTED);
needReload();
deobfForce.addItemListener(e -> {
settings.setDeobfuscationForceSave(e.getStateChange() == ItemEvent.SELECTED);
needReload();
deobfSourceAlias.addItemListener(e -> {
settings.setDeobfuscationUseSourceNameAsAlias(e.getStateChange() == ItemEvent.SELECTED);
needReload();
deobfOn.addItemListener(e -> enableComponentList(connectedComponents, e.getStateChange() == ItemEvent.SELECTED));
enableComponentList(connectedComponents, settings.isDeobfuscationOn());
return deobfGroup;
代码示例来源:origin: skylot/jadx
private SettingsGroup makeDecompilationGroup() {
JCheckBox fallback = new JCheckBox();
fallback.setSelected(settings.isFallbackMode());
fallback.addItemListener(e -> {
settings.setFallbackMode(e.getStateChange() == ItemEvent.SELECTED);
needReload();
showInconsistentCode.addItemListener(e -> {
settings.setShowInconsistentCode(e.getStateChange() == ItemEvent.SELECTED);
needReload();
resourceDecode.addItemListener(e -> {
settings.setSkipResources(e.getStateChange() == ItemEvent.SELECTED);
needReload();
autoStartJobs.addItemListener(e -> settings.setAutoStartJobs(e.getStateChange() == ItemEvent.SELECTED));
escapeUnicode.addItemListener(e -> {
settings.setEscapeUnicode(e.getStateChange() == ItemEvent.SELECTED);
needReload();
replaceConsts.addItemListener(e -> {
settings.setReplaceConsts(e.getStateChange() == ItemEvent.SELECTED);
needReload();
useImports.addItemListener(e -> {
settings.setUseImports(e.getStateChange() == ItemEvent.SELECTED);
needReload();
代码示例来源:origin: chewiebug/GCViewer
public TimeOffsetPanel(JPopupMenu popup) {
this.popup = popup;
timeSpinner = new JSpinner(new SpinnerDateModel());
timeSpinner.setEditor(new JSpinner.DateEditor(timeSpinner, getPattern()));
setOffsetCheckBox = new JCheckBox(LocalisationHelper.getString("timeoffset_prompt"), true);
setOffsetCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
timeSpinner.setEnabled(setOffsetCheckBox.isSelected());
fireTimeOffsetPanelStateChanged(setOffsetCheckBox.isSelected());
}
});
add(setOffsetCheckBox);
add(timeSpinner);
getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), OK_ACTION_MAP_KEY);
getActionMap().put(OK_ACTION_MAP_KEY, new AbstractAction() {
public void actionPerformed(ActionEvent e) {
TimeOffsetPanel.this.popup.setVisible(false);
fireTimeOffsetPanelStateChanged(setOffsetCheckBox.isSelected());
}
});
getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_ACTION_MAP_KEY);
getActionMap().put(CANCEL_ACTION_MAP_KEY, new AbstractAction() {
public void actionPerformed(ActionEvent e) {
TimeOffsetPanel.this.popup.setVisible(false);
}
});
}
代码示例来源:origin: marytts/marytts
cbSelected.setMargin(new java.awt.Insets(0, 0, 0, 0));
cbSelected.setPreferredSize(new java.awt.Dimension(200, 18));
cbSelected.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cbSelectedItemStateChanged(evt);
代码示例来源:origin: marytts/marytts
cbSelected.setMargin(new java.awt.Insets(0, 0, 0, 0));
cbSelected.setPreferredSize(new java.awt.Dimension(200, 18));
cbSelected.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cbSelectedItemStateChanged(evt);
代码示例来源:origin: runelite/runelite
alwaysOnTop.addItemListener(ev -> config.inspectorAlwaysOnTop(alwaysOnTop.isSelected()));
onConfigChanged(null);
bottomPanel.add(alwaysOnTop);
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
public SymfonyInstallerForm() {
checkBoxDemo.addItemListener(e -> {
boolean state = e.getStateChange() != ItemEvent.SELECTED;
buttonRefresh.setEnabled(state);
comboVersions.setEnabled(state);
});
buttonRefresh.addActionListener(e -> appendSymfonyVersions());
// @TODO: use com.intellij.util.ui.ReloadableComboBoxPanel in Phpstorm9 api level
comboVersions.setRenderer(new ListCellRenderer());
appendSymfonyVersions();
}
代码示例来源:origin: stackoverflow.com
checkBox.addItemListener(new ItemListener(){
@Override
public void itemStateChanged(ItemEvent e) {
代码示例来源:origin: magefree/mage
uiDialog.getRedownloadCheckbox().addItemListener(this::checkboxRedowloadChanged);
内容来源于网络,如有侵权,请联系作者删除!