Java Swing: how to listen to JComboBox's width changes?
Posted
by agnieszka
on Stack Overflow
See other posts from Stack Overflow
or by agnieszka
Published on 2010-04-26T10:01:03Z
Indexed on
2010/04/26
10:03 UTC
Read the original article
Hit count: 273
I tried PropertyChangeListener with property set to "width", "Width", "size" and "Size".
PropertyChangeListener widthChangeListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
//code
}
};
streamsComboBox.addPropertyChangeListener("width", widthChangeListener);
projectsComboBox.addPropertyChangeListener("width", widthChangeListener);
vobsComboBox.addPropertyChangeListener("width", widthChangeListener);
Nothing works - the handler method is never fired.
What should I do to handle JComboBox's size change? Where does the property name come from anyway?
© Stack Overflow or respective owner