Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6.3
-
Fix Version/s: 1.6.4, 1.7-beta-1
-
Component/s: Swing
-
Labels:None
-
Environment:Windows XP, Java 6
-
Number of attachments :
Description
I have a small class that tests SwingBuilder.bind(). One textfield in the
GUI is bound to a model property of type Date so that a conversion is
needed from String to Date. The binding specifies a converter.
Unfortunately, when the GUI fires up, an exception is thrown saying this:
Exception in thread "main" java.lang.RuntimeException: Failed to create
component for 'bind' reason:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast
object '01.01.1970' with class 'java.lang.String' to class
'java.util.Date'
This message shows me that the converter has not been invoked.
Attached, I send the sample code and the stacktrace. In the
code, there is a section that works fine (commented out) and a section
that throws the exception (non-commented, active code). It seems as if the
full binding syntax does not work as good as the simplified syntax.
However, I need the full syntax because I really want to bind to a
FocusLost event, not to a property.
The stack trace of the exception thrown.