當前位置: 首頁>>代碼示例>>Java>>正文


Java Checkbox.setEnabled方法代碼示例

本文整理匯總了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;
}
 
開發者ID:seqcode,項目名稱:seqcode-core,代碼行數:23,代碼來源:SeqDataEditEntryForm.java

示例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;
}
 
開發者ID:bonej-org,項目名稱:BoneJ2,代碼行數:33,代碼來源:Anisotropy.java

示例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;
}
 
開發者ID:bonej-org,項目名稱:BoneJ2,代碼行數:39,代碼來源:SliceGeometry.java

示例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();

}
 
開發者ID:tferr,項目名稱:hIPNAT,代碼行數:29,代碼來源:Strahler.java

示例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;
}
 
開發者ID:fiji,項目名稱:AnalyzeSkeleton,代碼行數:13,代碼來源:AnalyzeSkeleton_.java

示例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());
}
 
開發者ID:arpruss,項目名稱:brainflex,代碼行數:12,代碼來源:Options.java

示例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);
}
 
開發者ID:vedipen,項目名稱:food-delivery-database-management,代碼行數:52,代碼來源:Login.java


注:本文中的java.awt.Checkbox.setEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。