Hi,
I need to modify an old applet with an awt.choice, i want get old value
before change it
1 i have implement an PropertyChangeListener
2 add Listener for choice component
3 but i never go to my method
An idea ?
Regards
Philippe
public class TComponentCustomizerm extends Panel implements Customizer,
ItemListener, // to handle Choice list events
ActionListener,
PropertyChangeListener
{
protected Choice typeChoice = new Choice();
................
public TComponentCustomizerm()
{
super();
setLayout(new GridBagLayout());
typeChoice.addPropertyChangeListener(this);
}
public void propertyChange(PropertyChangeEvent evt ){
System.out.println("propertyChange01 ");
System.out.println("propertyChange02 "+evt.getOldValue());
System.out.println("propertyChange03 "+evt.getNewValue());
}
hiwa - 03 Nov 2006 07:33 GMT
> Hi,
>
[quoted text clipped - 36 lines]
>
> }
<quote>
Adds a PropertyChangeListener to the listener list for a specific
property. The specified property may be user-defined, or one of the
following:
* this Component's font ("font")
* this Component's background color ("background")
* this Component's foreground color ("foreground")
* this Component's focusability ("focusable")
* this Component's focus traversal keys enabled state
("focusTraversalKeysEnabled")
* this Component's Set of FORWARD_TRAVERSAL_KEYS
("forwardFocusTraversalKeys")
* this Component's Set of BACKWARD_TRAVERSAL_KEYS
("backwardFocusTraversalKeys")
* this Component's Set of UP_CYCLE_TRAVERSAL_KEYS
("upCycleFocusTraversalKeys")
Note that if this Component is inheriting a bound property, then no
event will be fired in response to a change in the inherited property.
</quote>
Try call typeChoice.setForeground() from other GUI event handler.
pcouas - 03 Nov 2006 11:35 GMT
hI?
i have herited awt.Choice and implemented an old value in two select
methods before super.select
Thanks
Philippe