AWT CHOICE old value ?

P

pcouas

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());



}
 
H

hiwa

pcouas said:
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());



}
<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.
 
P

pcouas

hI?

i have herited awt.Choice and implemented an old value in two select
methods before super.select

Thanks
Philippe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top