本文整理匯總了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;
}
}