本文整理汇总了Java中javax.swing.JCheckBox.doClick方法的典型用法代码示例。如果您正苦于以下问题:Java JCheckBox.doClick方法的具体用法?Java JCheckBox.doClick怎么用?Java JCheckBox.doClick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JCheckBox
的用法示例。
在下文中一共展示了JCheckBox.doClick方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAlgorithms
import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void setAlgorithms() {
if ((data.isWhatifAlgorithms() && !compMultiAlg.isSelected()) || (!data.isWhatifAlgorithms() && compMultiAlg.isSelected())) {
algPanel.setVisible(true);
compMultiAlg.setSelected(true);
}
if (!data.isClosed()) {
compMultiAlg.setEnabled(false);
}
for (Entry<SolverAlgorithm, JCheckBox> e : this.algCheckBoxes.entrySet()) {
SolverAlgorithm algo = e.getKey();
boolean selected = (data.getWhatifAlgorithms().contains(algo));
JCheckBox checkbox = e.getValue();
if ((selected && !checkbox.isSelected()) || (!selected && checkbox.isSelected())) {
checkbox.doClick();
}
if (!data.isClosed()) {
checkbox.setEnabled(false);
}
if (!algo.isExact()) {
algTolerances.get(algo).setText(numFormat.format(data.getWhatifAlgorithmTolerance(algo)));
if (!data.isClosed()) {
algToleranceLabels.get(algo).setEnabled(false);
algTolerances.get(algo).setEnabled(false);
}
}
}
}
示例2: testNewJavaProject
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/** Test creation of java project.
* - open New Project wizard from main menu (File|New Project)
* - select Java Application project from Standard category
* - in the next panel type project name and project location in
* - finish the wizard
* - wait until project appears in projects view
* - wait classpath scanning finished
*/
public void testNewJavaProject() {
NewProjectWizardOperator.invoke().cancel();
NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();
// "Standard"
String standardLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "Templates/Project/Standard");
npwo.selectCategory(standardLabel);
// "Java Application"
String javaApplicationLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "template_app");
npwo.selectProject(javaApplicationLabel);
npwo.next();
NewJavaProjectNameLocationStepOperator npnlso = new NewJavaProjectNameLocationStepOperator();
npnlso.txtProjectName().setText(SAMPLE_PROJECT_NAME);
npnlso.txtProjectLocation().setText(System.getProperty("netbeans.user")); // NOI18N
npnlso.btFinish().pushNoBlock();
npnlso.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 120000);
npnlso.waitClosed();
// wait project appear in projects view
new ProjectsTabOperator().getProjectRootNode(SAMPLE_PROJECT_NAME);
//disable the compile on save:
ProjectsTabOperator.invoke().getProjectRootNode(SAMPLE_PROJECT_NAME).properties();
// "Project Properties"
String projectPropertiesTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Customizer_Title");
NbDialogOperator propertiesDialogOper = new NbDialogOperator(projectPropertiesTitle);
// select "Compile" category
String buildCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_BuildCategory");
String compileCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_Build");
new Node(new Node(new JTreeOperator(propertiesDialogOper), buildCategoryTitle), compileCategoryTitle).select();
// actually disable the quick run:
String compileOnSaveLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "CustomizerCompile.CompileOnSave");
JCheckBox cb = JCheckBoxOperator.waitJCheckBox((Container) propertiesDialogOper.getSource(), compileOnSaveLabel, true, true);
if (cb.isSelected()) {
cb.doClick();
}
// confirm properties dialog
propertiesDialogOper.ok();
// wait classpath scanning finished
PerfWatchProjects.waitScanFinished();
}
示例3: testNewProject
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/** Test creation of java project.
* - open New Project wizard from main menu (File|New Project)
* - select Java Application project from Standard category
* - in the next panel type project name and project location in
* - finish the wizard
* - wait until project appears in projects view
* - wait classpath scanning finished
*/
public void testNewProject() {
NewProjectWizardOperator.invoke().cancel();
NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();
// "Standard"
String standardLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "Templates/Project/Standard");
npwo.selectCategory(standardLabel);
// "Java Application"
String javaApplicationLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "template_app");
npwo.selectProject(javaApplicationLabel);
npwo.next();
NewJavaProjectNameLocationStepOperator npnlso = new NewJavaProjectNameLocationStepOperator();
npnlso.txtProjectName().setText(SAMPLE_PROJECT_NAME);
npnlso.txtProjectLocation().setText(System.getProperty("netbeans.user")); // NOI18N
npnlso.btFinish().pushNoBlock();
npnlso.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 120000);
npnlso.waitClosed();
// wait project appear in projects view
new ProjectsTabOperator().getProjectRootNode(SAMPLE_PROJECT_NAME);
//disable the compile on save:
ProjectsTabOperator.invoke().getProjectRootNode(SAMPLE_PROJECT_NAME).properties();
// "Project Properties"
String projectPropertiesTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Customizer_Title");
NbDialogOperator propertiesDialogOper = new NbDialogOperator(projectPropertiesTitle);
// select "Compile" category
String buildCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_BuildCategory");
String compileCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_Build");
new Node(new Node(new JTreeOperator(propertiesDialogOper), buildCategoryTitle), compileCategoryTitle).select();
// actually disable the quick run:
String compileOnSaveLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "CustomizerCompile.CompileOnSave");
JCheckBox cb = JCheckBoxOperator.waitJCheckBox((Container) propertiesDialogOper.getSource(), compileOnSaveLabel, true, true);
if (cb.isSelected()) {
cb.doClick();
}
// confirm properties dialog
propertiesDialogOper.ok();
// wait classpath scanning finished
WatchProjects.waitScanFinished();
}