-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b68
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8098695 | emb-9 | Sergey Bylokhov | P4 | Resolved | Fixed | team |
JDK-8129153 | 8u65 | Sergey Bylokhov | P4 | Resolved | Fixed | b02 |
JDK-8085856 | 8u60 | Sergey Bylokhov | P4 | Resolved | Fixed | b20 |
JDK-8138224 | emb-8u65 | Unassigned | P4 | Resolved | Fixed | b02 |
JDK-8129677 | emb-8u60 | Sergey Bylokhov | P4 | Resolved | Fixed | b20 |
A DESCRIPTION OF THE PROBLEM :
There are three typos in the example given at the top.
1. Remove the second left brace in the " catch ... " line.
2. Terminate " JComponent editor = spinner.getEditor() " with a semicolon.
3. A closing parenthesis is missing before the semicolon in
" ((DefaultEditor)editor).getTextField().setValue(spinner.getValue(); "
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
try {
spinner.commitEdit();
}
catch (ParseException pe) {
// Edited value is invalid, spinner.getValue() will return
// the last valid value, you could revert the spinner to show that:
JComponent editor = spinner.getEditor();
if (editor instanceof DefaultEditor) {
((DefaultEditor)editor).getTextField().setValue(spinner.getValue());
}
// reset the value to some known value:
spinner.setValue(fallbackValue);
// or treat the last valid value as the current, in which
// case you don't need to do anything.
}
return spinner.getValue();
ACTUAL -
See above.
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/7/docs/api/
There are three typos in the example given at the top.
1. Remove the second left brace in the " catch ... " line.
2. Terminate " JComponent editor = spinner.getEditor() " with a semicolon.
3. A closing parenthesis is missing before the semicolon in
" ((DefaultEditor)editor).getTextField().setValue(spinner.getValue(); "
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
try {
spinner.commitEdit();
}
catch (ParseException pe) {
// Edited value is invalid, spinner.getValue() will return
// the last valid value, you could revert the spinner to show that:
JComponent editor = spinner.getEditor();
if (editor instanceof DefaultEditor) {
((DefaultEditor)editor).getTextField().setValue(spinner.getValue());
}
// reset the value to some known value:
spinner.setValue(fallbackValue);
// or treat the last valid value as the current, in which
// case you don't need to do anything.
}
return spinner.getValue();
ACTUAL -
See above.
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/7/docs/api/
- backported by
-
JDK-8085856 JavaDoc for JSpinner contains errors
-
- Resolved
-
-
JDK-8098695 JavaDoc for JSpinner contains errors
-
- Resolved
-
-
JDK-8129153 JavaDoc for JSpinner contains errors
-
- Resolved
-
-
JDK-8129677 JavaDoc for JSpinner contains errors
-
- Resolved
-
-
JDK-8138224 JavaDoc for JSpinner contains errors
-
- Resolved
-