本文整理汇总了Java中java.awt.Checkbox.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Checkbox.setEnabled方法的具体用法?Java Checkbox.setEnabled怎么用?Java Checkbox.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Checkbox
的用法示例。
在下文中一共展示了Checkbox.setEnabled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPermissionsPanel
import java.awt.Checkbox; //导入方法依赖的package包/类
public JPanel getPermissionsPanel(){
JPanel permissionsPanel = new JPanel();
Font labelFont = new Font("SansSerif", Font.BOLD, 12);
Border paddingBorder = BorderFactory.createEmptyBorder(5,5,5,5);
JLabel labelPerm = new JLabel("Permissions"); labelPerm.setFont(labelFont); labelPerm.setBorder(paddingBorder); labelPerm.setAlignmentX(Component.LEFT_ALIGNMENT);
permissionsPanel.setLayout(new BoxLayout(permissionsPanel, BoxLayout.Y_AXIS));
permissionsPanel.add(labelPerm);
JPanel permCBPanel = new JPanel();
permCBPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
permCBPanel.setLayout(new GridLayout(0,2));
for(SeqDataUser u : users){
Checkbox cb = new Checkbox(u.getName(), sharedUsers.containsKey(u.getName()) && sharedUsers.get(u.getName()));
if(u.isAdmin())
cb.setEnabled(false);
userCheckboxes.put(u, cb);
permCBPanel.add(cb);
}
permissionsPanel.add(permCBPanel);
permissionsPanel.add(Box.createVerticalGlue());
return permissionsPanel;
}
示例2: dialogItemChanged
import java.awt.Checkbox; //导入方法依赖的package包/类
@Override
public boolean dialogItemChanged(final GenericDialog gd, final AWTEvent e) {
final Vector<?> checkboxes = gd.getCheckboxes();
final Vector<?> nFields = gd.getNumericFields();
final Checkbox autoModeBox = (Checkbox) checkboxes.get(0);
final Checkbox singleSphereBox = (Checkbox) checkboxes.get(1);
final Checkbox showPlotBox = (Checkbox) checkboxes.get(2);
final TextField radiusField = (TextField) nFields.get(0);
final TextField minSpheresField = (TextField) nFields.get(3);
final TextField maxSpheresField = (TextField) nFields.get(4);
final TextField toleranceField = (TextField) nFields.get(5);
if (singleSphereBox.getState()) {
radiusField.setEnabled(true);
autoModeBox.setEnabled(false);
showPlotBox.setEnabled(false);
minSpheresField.setEnabled(false);
maxSpheresField.setEnabled(false);
toleranceField.setEnabled(false);
} else {
radiusField.setEnabled(false);
autoModeBox.setEnabled(true);
showPlotBox.setEnabled(true);
minSpheresField.setEnabled(true);
maxSpheresField.setEnabled(true);
toleranceField.setEnabled(true);
}
DialogModifier.registerMacroValues(gd, gd.getComponents());
return true;
}
示例3: dialogItemChanged
import java.awt.Checkbox; //导入方法依赖的package包/类
@Override
public boolean dialogItemChanged(final GenericDialog gd, final AWTEvent e) {
if (!DialogModifier.allNumbersValid(gd.getNumericFields()))
return false;
final Vector<?> checkboxes = gd.getCheckboxes();
final Vector<?> nFields = gd.getNumericFields();
final Checkbox calibration = (Checkbox) checkboxes.get(10);
final boolean isHUCalibrated = calibration.getState();
final TextField minT = (TextField) nFields.get(0);
final TextField maxT = (TextField) nFields.get(1);
final double min = Double.parseDouble(minT.getText());
final double max = Double.parseDouble(maxT.getText());
if (isHUCalibrated && !fieldUpdated) {
minT.setText("" + cal.getCValue(min));
maxT.setText("" + cal.getCValue(max));
fieldUpdated = true;
}
if (!isHUCalibrated && fieldUpdated) {
minT.setText("" + cal.getRawValue(min));
maxT.setText("" + cal.getRawValue(max));
fieldUpdated = false;
}
if (isHUCalibrated)
DialogModifier.replaceUnitString(gd, "grey", "HU");
else
DialogModifier.replaceUnitString(gd, "HU", "grey");
final Checkbox oriented = (Checkbox) checkboxes.get(9);
if (orienteer == null) {
oriented.setState(false);
oriented.setEnabled(false);
} else
oriented.setEnabled(true);
DialogModifier.registerMacroValues(gd, gd.getComponents());
return true;
}
示例4: dialogItemChanged
import java.awt.Checkbox; //导入方法依赖的package包/类
@Override
public boolean dialogItemChanged(final GenericDialog gd, final java.awt.AWTEvent e) {
protectRoot = gd.getNextBoolean();
erodeIsolatedPixels = gd.getNextBoolean();
pruneChoice = gd.getNextChoiceIndex();
grayscaleImpChoice = gd.getNextChoiceIndex();
outIS = gd.getNextBoolean();
verbose = gd.getNextBoolean();
tabular = gd.getNextBoolean();
// Enable/Disable key components of GenericDialog
if (!IJ.macroRunning()) {
final Choice cImgChoice = (Choice) gd.getChoices().elementAt(1);
final Vector<?> checkboxes = gd.getCheckboxes();
final Checkbox roiOption = (Checkbox) checkboxes.elementAt(0);
final Checkbox stackOption = (Checkbox) checkboxes.elementAt(2);
cImgChoice.setEnabled(pruneChoice == AnalyzeSkeleton_.LOWEST_INTENSITY_VOXEL
|| pruneChoice == AnalyzeSkeleton_.LOWEST_INTENSITY_BRANCH);
roiOption.setEnabled(validRootRoi);
stackOption.setEnabled(!tabular);
}
return !gd.wasCanceled();
}
示例5: dialogItemChanged
import java.awt.Checkbox; //导入方法依赖的package包/类
/** Disables dialog components that are irrelevant to GUI-based analysis. */
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e)
{
if ( this.imRef.getRoi() == null && null != gd
&& null != gd.getCheckboxes() )
{
Checkbox roiOption = (Checkbox)gd.getCheckboxes().elementAt(1);
roiOption.setEnabled(false);
if (Recorder.record) roiOption.setState(false);
}
return true;
}
示例6: updateNotes
import java.awt.Checkbox; //导入方法依赖的package包/类
protected void updateNotes(JLabel notes, Checkbox heartCheck, Checkbox rawCheck,
Checkbox powerCheck) {
if (!heartCheck.getState() && !rawCheck.getState() && !powerCheck.getState()) {
notes.setText("At least one data window needs to be active.");
}
else {
notes.setText("");
}
rawCheck.setEnabled(!heartCheck.getState());
powerCheck.setEnabled(!heartCheck.getState());
}
示例7: Login
import java.awt.Checkbox; //导入方法依赖的package包/类
Login()
{
setSize(400,190);
setTitle("Login");
setVisible(true);
setResizable(false);
setLayout(null);
setLocation(400,270);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent we)
{
if(!fg)
dispose();
}
});
//add(fg);
f=new Font("Georgia",Font.BOLD,14);
setFont(f);
tt1=new TextField();
tt1.setBounds(110,40,150,30);
tt2=new TextField();
tt2.setBounds(110,80,150,30);
tt2.setEchoChar('*');
ll1=new Label("Username:");
ll1.setBounds(25,40,80,20);
ll2=new Label("Password:");
ll2.setBounds(25,80,80,20);
ll3=new Label("");
ll3.setBounds(30,110,250,20);
ll3.setForeground(Color.red);
bb1=new Button("Login");
bb1.setBounds(280,125,100,50);
bb1.setForeground(Color.BLUE);
cb=new Checkbox("Remember Me",false);
cb.setBounds(40,130,150,20);
cb.setEnabled(true);
bb1.addActionListener(this);
add(tt1);
add(cb);
add(tt2);
add(ll3);
add(ll2);
add(ll1);
add(bb1);
}