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