ComboBox::setText a little broken


#1

When you call setText (or setSelectedId) with dontSendChangeMessage set to true, a change message will be sent anyway. This is because SimpleValueSource::setValue class sends a change message regardless of the state of dontSendChangeMessage. Could this be fixed please?


#2

Well, yes the Value will send a message to its listeners, but the ComboBox won’t send one to its ComboBox::Listeners, which is what that flag means…


#3

Oops. Sorry for the noise. setValue was not the origin of the change message. It came from calling clear without dontSendChangeMessage set.


#4

There is another small glitch related to this. If you override mouseWheelMove in a ComboBox, you’ll receive two mouseWheelMove messages, one from the ComboBox and one from the label. Not cool. The solution is to look at the MouseEvent component (e.eventComponent) and only use the event sent by the ComboBox. Thought this might help somebody.


#5

You shouldn’t be subclassing these controls. Instead, consider attaching a MouseListener.