-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
6
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows XP ver 5.1 SP 2
A DESCRIPTION OF THE PROBLEM :
When specifying
"dd.MM.yyyy kk:mm:ss:SS"
as the Format for the DateEditor used by a JSpinner with SpinnerDateModel, you can't spin the 'kk'-Part of the String.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Define a JSpinner with SpinnerDateModel.
Set the Editor up with a Format-Specification that includes a "Hour in day (1-24)" SimpleDateFormat (kk).
Run the Application and try to spin the hour-Value.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
All Values can be spun by shifting the Carret at the right position and clicking one of the spin Buttons. The right Value is highlighted.
ACTUAL -
The Hours-Value specified as "Hour in day (1-24)" kk can not be spun and is not highlighted.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Calendar;
import java.util.Date;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerDateModel;
public class Test extends JPanel
{
private static JSpinner dateSpinner;
private static final String FORMAT = "dd.MM.yyyy kk:mm:ss:SS";
public static void main(String[] args) {
dateSpinner = new JSpinner(new SpinnerDateModel(new Date(System.currentTimeMillis()), null, null, Calendar.YEAR));
dateSpinner.setEditor(new JSpinner.DateEditor(dateSpinner, Test.FORMAT));
Test f = new Test();
f.add(dateSpinner);
JOptionPane.showConfirmDialog(null, f);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use 'HH' instead of 'kk' which is 'Hour in day (0-23)'.
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows XP ver 5.1 SP 2
A DESCRIPTION OF THE PROBLEM :
When specifying
"dd.MM.yyyy kk:mm:ss:SS"
as the Format for the DateEditor used by a JSpinner with SpinnerDateModel, you can't spin the 'kk'-Part of the String.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Define a JSpinner with SpinnerDateModel.
Set the Editor up with a Format-Specification that includes a "Hour in day (1-24)" SimpleDateFormat (kk).
Run the Application and try to spin the hour-Value.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
All Values can be spun by shifting the Carret at the right position and clicking one of the spin Buttons. The right Value is highlighted.
ACTUAL -
The Hours-Value specified as "Hour in day (1-24)" kk can not be spun and is not highlighted.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.Calendar;
import java.util.Date;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerDateModel;
public class Test extends JPanel
{
private static JSpinner dateSpinner;
private static final String FORMAT = "dd.MM.yyyy kk:mm:ss:SS";
public static void main(String[] args) {
dateSpinner = new JSpinner(new SpinnerDateModel(new Date(System.currentTimeMillis()), null, null, Calendar.YEAR));
dateSpinner.setEditor(new JSpinner.DateEditor(dateSpinner, Test.FORMAT));
Test f = new Test();
f.add(dateSpinner);
JOptionPane.showConfirmDialog(null, f);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use 'HH' instead of 'kk' which is 'Hour in day (0-23)'.