本文整理汇总了Java中javax.swing.JCheckBox.isSelected方法的典型用法代码示例。如果您正苦于以下问题:Java JCheckBox.isSelected方法的具体用法?Java JCheckBox.isSelected怎么用?Java JCheckBox.isSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JCheckBox
的用法示例。
在下文中一共展示了JCheckBox.isSelected方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setContext
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public CodeTemplatesOperator setContext(Set<String> set) {
JTabbedPaneOperator tabbedPane = getTabbedPane();
tabbedPane.selectPage("Contexts");
ContainerOperator<JEditorPane> selectedComponent = new ContainerOperator<>((Container)tabbedPane.getSelectedComponent());
JListOperator list = new JListOperator(selectedComponent);
for (int i = 0; i < list.getModel().getSize(); i++) {
JCheckBox checkBox = (JCheckBox) list.getRenderedComponent(i);
String contextName = checkBox.getText();
list.scrollToItem(i);
if(!checkBox.isSelected() && set.contains(contextName)) {
list.selectItem(i);
} else if(checkBox.isSelected() && !set.contains(contextName)) {
list.selectItem(i);
}
}
return this;
}
示例2: mouseClicked
import javax.swing.JCheckBox; //导入方法依赖的package包/类
@Override final public void mouseClicked(MouseEvent objPmouseEvent) {
JCheckBox objLjCheckBox = null;
switch (this.bytGbooleanGlobalFilter) {
case Constants.bytS_BOOLEAN_GLOBAL_MARK:
objLjCheckBox = this.objGcontrolJFrame.objGmarkJCheckBox;
break;
case Constants.bytS_BOOLEAN_GLOBAL_SKILL:
objLjCheckBox = this.objGcontrolJFrame.objGskillJCheckBox;
break;
case Constants.bytS_BOOLEAN_GLOBAL_BALLS_NUMBER:
objLjCheckBox = this.objGcontrolJFrame.objGballsNumberJCheckBox;
break;
}
if (objLjCheckBox != null && objLjCheckBox.isEnabled()) {
final boolean bolLselected = !objLjCheckBox.isSelected();
objLjCheckBox.setSelected(bolLselected);
this.objGcontrolJFrame.setFiltersControls();
}
}
示例3: getDupAction
import javax.swing.JCheckBox; //导入方法依赖的package包/类
int getDupAction(String url) {
JTextField txt = new JTextField(url, 30);
String lbl = StringResource.getString("DUP_TXT");
JComboBox choice = new JComboBox(new String[] { StringResource.getString("DUP_OP1"),
StringResource.getString("DUP_OP2"), StringResource.getString("DUP_OP3") });
JCheckBox chk = new JCheckBox(StringResource.getString("DUP_CHK"));
int ret = JOptionPane.showOptionDialog(null, new Object[] { txt, lbl, choice, chk },
StringResource.getString("DUP_TITLE"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,
null, null);
if (ret == JOptionPane.OK_OPTION) {
int index = choice.getSelectedIndex();
if (chk.isSelected()) {
config.duplicateLinkAction = index;
}
return index;
}
return -1;
}
示例4: actionPerformed
import javax.swing.JCheckBox; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();
if (obj == this.alteracaoLanche.getBtn_Cancelar()) {
this.alteracaoLanche.dispose();
} else if (obj == this.alteracaoLanche.getBtn_Finalizar()) {
finalizado();
} else if (this.alteracaoLanche.getBotoes().contains(obj)) {
for (JCheckBox botao : this.alteracaoLanche.getBotoes()) {
if (obj == botao) {
System.out.println(botao.getText());
if (botao.isSelected()) {
adiciona(botao.getText());
// txt_Obs.setText("Com: " + ckb_Ingrediente1.getText() );
} else {
retira(botao.getText());
// txt_Obs.setText("Sem: " + ckb_Ingrediente1.getText());
}
}
}
}
}
示例5: big
import javax.swing.JCheckBox; //导入方法依赖的package包/类
@NbBundle.Messages({
"TTL_ContextView_showBigFile=Show Big File?",
"# {0} - file name",
"# {1} - file size in kilobytes",
"MSG_ContextView_showBigFile=File {0} is quite big ({1} kB).\n"
+ "Showing it can cause memory and performance problems.\n"
+ "Do you want to show content of this file?",
"LBL_ContextView_Show=Show",
"LBL_ContextView_Skip=Do Not Show",
"LBL_ContextView_ApplyAll=Apply to all big files"
})
private void approveFetchingOfBigFile(final MatchingObject mo,
final int partIndex) {
FileObject fo = mo.getFileObject();
long fileSize = fo.getSize() / 1024;
JButton showButton = new JButton(Bundle.LBL_ContextView_Show());
JButton skipButton = new JButton(Bundle.LBL_ContextView_Skip());
JCheckBox all = new JCheckBox(Bundle.LBL_ContextView_ApplyAll());
all.setSelected(approveApplyToAllSelected);
JPanel allPanel = new JPanel();
allPanel.add(all); //Add to panel not to be handled as standard button.
NotifyDescriptor nd = new NotifyDescriptor(
Bundle.MSG_ContextView_showBigFile(
fo.getNameExt(), fileSize),
Bundle.TTL_ContextView_showBigFile(),
NotifyDescriptor.YES_NO_OPTION,
NotifyDescriptor.WARNING_MESSAGE,
new Object[]{skipButton, showButton},
lastApproveOption ? showButton : skipButton);
nd.setAdditionalOptions(new Object[]{allPanel});
DialogDisplayer.getDefault().notify(nd);
boolean app = nd.getValue() == showButton;
APPROVED_FILES.put(fo, app);
if (all.isSelected()) {
allApproved = app;
}
approveApplyToAllSelected = all.isSelected();
lastApproveOption = app;
displayFile(mo, partIndex);
}
示例6: getKivaTasks
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
* Gets the selected kiva tasks.
*
* @return A set containing all selected kiva tasks
*/
public Set<EKivaTask> getKivaTasks() {
final Set<EKivaTask> kivaTasks = new HashSet<>();
for (final JCheckBox taskBox : this.mTaskList) {
if (taskBox.isSelected()) {
final String text = taskBox.getText();
kivaTasks.add(EKivaTask.valueOf(text));
}
}
return kivaTasks;
}
示例7: deleteGroups
import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void deleteGroups() {
List<GroupNode> groupNodes = getSelectedGroupNodes();
if (!groupNodes.isEmpty()) {
String question = "<html><body><p style='width: 200px;'>"
+ "Are you sure want to delete the following Groups?<br>"
+ groupNodes
+ "</p></body></html>";
JCheckBox confirmBox = new JCheckBox("Move Reusables inside Group to TestPlan instead of deleting");
int option = JOptionPane.showConfirmDialog(null,
new Object[]{question, confirmBox},
"Delete TestCase",
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION) {
LOGGER.log(Level.INFO, "Delete Reusable Groups approved for {0}; {1}",
new Object[]{groupNodes.size(), groupNodes});
for (GroupNode groupNode : groupNodes) {
if (confirmBox.isSelected()) {
getTreeModel().toggleAllTestCasesFrom(groupNode);
}
getTreeModel().removeNodeFromParent(groupNode);
}
if (confirmBox.isSelected()) {
getTestDesign().getProjectTree().load();
}
}
}
}
示例8: fireChanged
import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void fireChanged() {
Preferences node = MarkOccurencesSettings.getCurrentNode();
for (JCheckBox box : boxes) {
if (node.getBoolean(box.getActionCommand(), DEFAULT_VALUE) != box.isSelected()) {
changed = true;
return;
}
}
changed = false;
}
示例9: CheckBoxParameter
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public CheckBoxParameter(JCheckBox chk, String parameter, String encoding) {
super(parameter, encoding);
this.chk = chk;
chk.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
fireStateChanged();
}
});
original = chk.isSelected();
}
示例10: getSelected
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public List<Qualifier> getSelected() {
ArrayList<Qualifier> res = new ArrayList<Qualifier>();
int i = 0;
for (JCheckBox box : boxes) {
if (box.isSelected()) {
res.add(qualifiers.get(i));
}
i++;
}
return res;
}
示例11: stateChanged
import javax.swing.JCheckBox; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e)
{
JCheckBox v_IsLike = (JCheckBox)e.getSource();
if ( v_IsLike.isSelected() )
{
v_IsLike.setText("精确");
}
else
{
v_IsLike.setText("模糊");
}
}
示例12: generateToolTipTextForVisibilityCheckBox
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
* Generates a ToolTip text for visibility checkboxes based on their current selection state
* @param checkBox The checkbox to generate a text for
* @return The tooltip text
*/
private String generateToolTipTextForVisibilityCheckBox(JCheckBox checkBox){
if(checkBox.isSelected()){
return "Hide " + checkBox.getText();
}else{
return "Show " + checkBox.getText();
}
}
示例13: isOptionChecked
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
* Checks, if the specified check box is selected.
*
* @param index
* Index of the check box to examine
* @return true, if the check box is selected
*/
public boolean isOptionChecked(int index) {
if (index >= checkboxPanel.getComponents().length) {
return false;
}
JCheckBox checkbox = (JCheckBox) checkboxPanel.getComponent(index);
if (checkbox.isSelected()) {
return true;
} else {
return false;
}
}
示例14: actionPerformed
import javax.swing.JCheckBox; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e)
{
if( e.getSource() instanceof JCheckBox )
{
JCheckBox box = (JCheckBox) e.getSource();
if( checkboxes.values().contains(e.getSource()) )
{
// need to reverse lookup the NameValue...
for( Map.Entry<NameValue, JCheckBox> entry : checkboxes.entrySet() )
{
if( entry.getValue() == box )
{
NameValue nv = entry.getKey();
if( box.isSelected() )
{
choiceSelected(nv);
}
else
{
choiceDeselected(nv);
}
}
}
}
}
}
示例15: actionPerformed
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
// Get the checkbox and its value
JCheckBox sourcefield = (JCheckBox) e.getSource();
Boolean isRoundRobinChecked = new Boolean(sourcefield.isSelected());
// Set the Round-Robin parameter
current.getParameter(5).setValue(isRoundRobinChecked);
refreshValues();
}