本文整理汇总了Java中java.awt.Checkbox.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java Checkbox.setSize方法的具体用法?Java Checkbox.setSize怎么用?Java Checkbox.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Checkbox
的用法示例。
在下文中一共展示了Checkbox.setSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HashPreferences
import java.awt.Checkbox; //导入方法依赖的package包/类
public HashPreferences() {
setLayout(null);
explanation = new MessagePanel(
"Enables files to be hashed in the background so they can be downloaded with multi source download.\n\n"
+ "NOTE: Files stop hashing after the current one.");
explanation.setLocation(0, 0);
explanation.setSize(STD_XSIZE, STD_YSIZE / 2 - CHECKBOX_Y_SIZE);
add(explanation);
enableHashing = new Checkbox("Enabling File Hashing");
enableHashing.setLocation(50, STD_YSIZE / 2 - CHECKBOX_Y_SIZE);
enableHashing.setSize(STD_XSIZE - 50, CHECKBOX_Y_SIZE);
add(enableHashing);
setSize(STD_XSIZE, STD_YSIZE);
}
示例2: dialogItemChanged
import java.awt.Checkbox; //导入方法依赖的package包/类
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) {
chosenFilter = gd.getNextChoice();
chosenRadius = (double) gd.getNextNumber();
chosenIteration = (int) gd.getNextNumber();
Checkbox previewCheckbox = (Checkbox) gd.getCheckboxes().get(0);
if (gd.invalidNumber() || chosenRadius<=0 || chosenRadius>3 || chosenIteration<1 || chosenIteration>500) {
if (previewCheckbox.getState()) {
previewCheckbox.setSize(130, 20);
previewCheckbox.setLabel("Invalid number");
}
return false;
} else {
return true;
}
}
示例3: dialogItemChanged
import java.awt.Checkbox; //导入方法依赖的package包/类
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) {
erosions = (int) gd.getNextNumber();
convexityThreshold = gd.getNextNumber();
separatorRange = gd.getNextString();
excludeRange = gd.getNextBoolean();
//read out the separator Range definitions
try {
separatorRange.substring(0, separatorRange.indexOf("-"));
} catch (java.lang.StringIndexOutOfBoundsException oobe) {
separatorRange = "-";
}
try {
AreaMin = Double.parseDouble(separatorRange.substring(0, separatorRange.indexOf("-")));
} catch (java.lang.NumberFormatException minException) {
AreaMin = Double.NaN;
}
String AreaInterMax = separatorRange.substring(separatorRange.indexOf("-")+1);
if(AreaInterMax.equals("Infinity") || AreaInterMax.equals("infinity")) {
AreaMax = Double.POSITIVE_INFINITY;
} else if(!AreaInterMax.equals("")){
try {
AreaMax = Double.parseDouble(separatorRange.substring(separatorRange.indexOf("-")+1));
} catch (java.lang.NumberFormatException maxException) {
AreaMax = Double.NaN;
}
}
Checkbox previewCheckbox = (Checkbox) gd.getCheckboxes().get(1);
if(gd.invalidNumber() || erosions<1 || convexityThreshold<0.0 || convexityThreshold>1.0 || separatorRange.equals("-") || separatorRange.substring(0, separatorRange.indexOf("-")).equals("") || separatorRange.substring(separatorRange.indexOf("-")+1).equals("") || Double.isNaN(AreaMin) || Double.isNaN(AreaMax)) {
if (previewCheckbox.getState()) {
previewCheckbox.setSize(130, 20);
previewCheckbox.setLabel("Invalid number");
}
return false;
} else {
return true;
}
}