I've been trying to create a custom JGoodies binding converter with no luck. Currently my model contains properties that are all simple types (strings, integers, etc). Everything is setup such that when a property changes the corresponding JLabel in my GUI changes. Okay...no problem.
But now I want to bind a custom object, not just a string or integer. So, for example I have something like the following:
My current working model class:
But now I'm trying to do something like:
I've thought that I would have to develop a custom converter (extending the com.jgoodies.binding.value.AbstractConverter class) that takes my custom object and converts it into a string representation because I then have:
but this gives me an exception:
Can anyone help? [ October 26, 2005: Message edited by: David Irwin ]
Caused by: java.lang.ClassCastException: The subject value must be of type HardwareData. at jhomenet.binding.CustomConverterFactory$DataConverter.convertFromSubject(Unknown Source) at com.jgoodies.binding.value.AbstractConverter.getValue(AbstractConverter.java:134)
I was getting a class cast exception because the first conversion was sending something other than my CustomObject. Now I've removed this excetion and simple returns a "NULL" string instead. Now it works.
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
SKIP - a book about connecting industrious people with elderly land owners