当前位置: 首页>>代码示例>>Java>>正文


Java JSpinner.setEditor方法代码示例

本文整理汇总了Java中javax.swing.JSpinner.setEditor方法的典型用法代码示例。如果您正苦于以下问题:Java JSpinner.setEditor方法的具体用法?Java JSpinner.setEditor怎么用?Java JSpinner.setEditor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JSpinner的用法示例。


在下文中一共展示了JSpinner.setEditor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDateSpinner

import javax.swing.JSpinner; //导入方法依赖的package包/类
private JSpinner createDateSpinner(Calendar calendar) {
    Date initDate = calendar.getTime();
    calendar.add(Calendar.YEAR, -100);
    Date earliestDate = calendar.getTime();
    calendar.add(Calendar.YEAR, 200);
    Date latestDate = calendar.getTime();
    SpinnerDateModel spinnerDateModel = new SpinnerDateModel(initDate, earliestDate, latestDate, Calendar.YEAR);
    JSpinner dateSpinner = new JSpinner(spinnerDateModel);
    dateSpinner.setEditor(new JSpinner.DateEditor(dateSpinner, "MM/yyyy"));
    dateSpinner.setName("date-spinner");
    return dateSpinner;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:JSpinnerJavaElementTest.java

示例2: ComparePanel

import javax.swing.JSpinner; //导入方法依赖的package包/类
public ComparePanel()
{
	dateSpinner = new JSpinner( new SpinnerDateModel() );
	JSpinner.DateEditor dateEditor = new JSpinner.DateEditor(dateSpinner, "dd.MM.yyyy");
	dateSpinner.setEditor(dateEditor);
	dateSpinner.setValue(new Date()); 
	timeSpinner = new JSpinner( new SpinnerDateModel() );
	JSpinner.DateEditor timeEditor = new JSpinner.DateEditor(timeSpinner, "HH:mm:ss");
	timeSpinner.setEditor(timeEditor);
	timeSpinner.setValue(new Date()); 
	
}
 
开发者ID:fossasia,项目名称:zooracle,代码行数:13,代码来源:ComparePanel.java

示例3: createNumberSpinner

import javax.swing.JSpinner; //导入方法依赖的package包/类
private JSpinner createNumberSpinner(Calendar calendar) {
    int currentYear = calendar.get(Calendar.YEAR);
    SpinnerModel yearModel = new SpinnerNumberModel(currentYear, currentYear - 100, currentYear + 100, 1);
    JSpinner numberSpinner = new JSpinner(yearModel);
    numberSpinner.setEditor(new JSpinner.NumberEditor(numberSpinner, "#"));
    numberSpinner.setName("number-spinner");
    return numberSpinner;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:JSpinnerJavaElementTest.java

示例4: createSchedulerPanel

import javax.swing.JSpinner; //导入方法依赖的package包/类
Box createSchedulerPanel() {
	Box box = Box.createVerticalBox();
	box.setOpaque(false);
	box.setBorder(new EmptyBorder(10, 0, 0, 10));

	Box b0 = Box.createHorizontalBox();
	schedule = new JCheckBox(getString("LBL_Q"));
	schedule.setContentAreaFilled(false);
	schedule.setFocusPainted(false);
	// schedule.addActionListener(this);
	b0.add(schedule);
	b0.setBorder(new EmptyBorder(0, 0, 10, 0));
	b0.add(Box.createHorizontalGlue());
	box.add(b0);

	start = new SpinnerDateModel();
	end = new SpinnerDateModel();

	startDate = new JSpinner(start);
	startDate.setEditor(new JSpinner.DateEditor(startDate,
			"dd-MMM-yy hh:mm a"));
	startDate.setMaximumSize(startDate.getPreferredSize());

	endDate = new JSpinner(end);
	endDate
			.setEditor(new JSpinner.DateEditor(endDate, "dd-MMM-yy hh:mm a"));
	endDate.setMaximumSize(endDate.getPreferredSize());

	Box b1 = Box.createHorizontalBox();
	b1.add(new JLabel(getString("LBL_START_Q")));
	b1.add(Box.createHorizontalGlue());
	b1.add(startDate);

	box.add(b1);
	box.add(Box.createRigidArea(new Dimension(10, 10)));

	Box b2 = Box.createHorizontalBox();
	b2.add(new JLabel(getString("LBL_STOP_Q")));
	b2.add(Box.createHorizontalGlue());
	b2.add(endDate);

	box.add(b2);

	return box;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:46,代码来源:ConfigDialog.java


注:本文中的javax.swing.JSpinner.setEditor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。