use of javax.swing.SpinnerDateModel in project knime-core by knime.
the class SleepNodeDialog method waitToTimePanel.
private void waitToTimePanel() {
m_waitToSpinnerModel = new SpinnerDateModel();
m_toSpinner = new JSpinner(m_waitToSpinnerModel);
m_toSpinner.setEditor(new JSpinner.DateEditor(m_toSpinner, "HH:mm:ss"));
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
m_waitToSpinnerModel.setValue(cal.getTime());
m_toRB = new JRadioButton("Wait to time:");
m_toRB.doClick();
m_toRB.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (m_toRB.isSelected()) {
m_selection = 1;
}
m_toSpinner.setEnabled(m_toRB.isSelected());
}
});
}
use of javax.swing.SpinnerDateModel in project knime-core by knime.
the class SleepNodeDialog method waitForTimePanel.
private void waitForTimePanel() {
m_waitForSpinnerModel = new SpinnerDateModel();
m_forSpinner = new JSpinner(m_waitForSpinnerModel);
m_forSpinner.setEditor(new JSpinner.DateEditor(m_forSpinner, "HH:mm:ss"));
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
m_waitForSpinnerModel.setValue(cal.getTime());
m_forRB = new JRadioButton("Wait for time:");
m_forRB.doClick();
m_forRB.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (m_forRB.isSelected()) {
m_selection = 0;
}
m_forSpinner.setEnabled(m_forRB.isSelected());
}
});
}
Aggregations