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


Java JSpinner.setEnabled方法代碼示例

本文整理匯總了Java中javax.swing.JSpinner.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java JSpinner.setEnabled方法的具體用法?Java JSpinner.setEnabled怎麽用?Java JSpinner.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JSpinner的用法示例。


在下文中一共展示了JSpinner.setEnabled方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupGUI

import javax.swing.JSpinner; //導入方法依賴的package包/類
private void setupGUI()
{
	JNameValuePanel panel1 = new JNameValuePanel();

	name = new I18nTextField(BundleCache.getLanguages());
	description = new I18nTextArea(BundleCache.getLanguages());

	owner = new SingleUserSelector(clientService.getService(RemoteUserService.class));

	// http://jira.pearsoncmg.com/jira/browse/EQ-1224
	code = new JSmartTextField(100);

	startDate = new DateSelector();
	endDate = new DateSelector();
	students = new JSpinner(new SpinnerNumberModel(1, 0, Integer.MAX_VALUE, 1));
	citations = new JComboBox(courseInfoService.getAllCitations().toArray());
	courseType = new JComboBox(CourseInfo.COURSE_TYPES.toArray());
	departmentName = new JTextField();
	archived = new JCheckBox();

	panel1.addTextAndComponent(getKey("courses.detailstab.name"), name); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.desc"), description); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.department"), departmentName); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("courses.detailstab.owner"), owner); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.code"), code); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.startdate"), startDate); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.enddate"), endDate); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.students"), students); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.citation"), citations); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.coursetype"), courseType); //$NON-NLS-1$
	panel1.addTextAndComponent(getKey("detailstab.archived"), archived); //$NON-NLS-1$

	// Make sure things are readonly.
	if( state.isReadonly() )
	{
		name.setEnabled(false);
		description.setEnabled(false);
		owner.setEnabled(false);
		code.setEnabled(false);
		startDate.setEnabled(false);
		endDate.setEnabled(false);
		students.setEnabled(false);
		departmentName.setEnabled(false);
		courseType.setEditable(false);
	}

	final int[] rows = {TableLayout.FILL,};
	final int[] cols = {TableLayout.DOUBLE_FILL, TableLayout.FILL,};

	setLayout(new TableLayout(rows, cols));
	add(panel1.getComponent(), new Rectangle(0, 0, 1, 1));
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:53,代碼來源:DetailsTab.java


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