Problem with JComboBox: No listener added

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Problem with JComboBox: No listener added

Postby Christian » Mon Nov 08, 2010 8:43 am

Dear Instantiations-Team,

thank you so much for providing this excellent tool. This is really what I was looking for!

I ran into a problem when building a GUI containing a JComboBox which I tried to bind to an enumeration. As binding attribute I used the "selectedIndex". The GUI picks up the right enum value which is given via a bean. However, the opposite direction does not seem to work: The bean is not "informed" about changes in the GUI (i.e. selecting a different value in the combo box).

When trying to debug the code I found that in method org.jdesktop.beansbinding:addPropertyChangeListener a log would be written:

log("addPropertyChangeListener()", "can't add listener");

I guess this causes the problem, but I do not know why the listener could not be added.

I build a small test case demonstrating the problem.

Your help is really highly appreciated.

this small test case shows three GUI elements: JTextBox, JTextBox with DateConverter and JComboBox with an "EnumConverter". Only the latter has problems and only in the direction GUI -> Bean.
(4.3 KiB) Downloaded 10 times
Posts: 1
Joined: Mon Nov 08, 2010 8:31 am

Re: Problem with JComboBox: No listener added

Postby Eric Clayberg » Mon Nov 08, 2010 6:15 pm

While this is not a Swing Designer issue, it looks like your bean does not implement PropertyChangeSupport.

See this earlier forum thread...

Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest