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