-
Enhancement
-
Resolution: Fixed
-
P4
-
1.4.2
-
beta
-
x86
-
windows_98
Name: rmT116609 Date: 04/15/2004
A DESCRIPTION OF THE REQUEST :
When javax.swing.Timer fires an ActionEvent it sets its actionCommand to null. There is no way to change the value of and actionCommand during the life of an ActionEvent. I think it would be good to have the following constructor:
Timer(int delay, ActionListener listener, String actionCommand)
which will allow to set an actionCommand value of the ActionEvents fired by the Timer.
JUSTIFICATION :
1. An actionCommand is a property of ActionEvent and there should be a possibility to set this property when the event objects are generated by the Timer.
2. An actionCommand can be used to easily distinguish between event sources.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Implement the constructor:
Timer(int delay, ActionListener listener, String actionCommand)
and
public void setActionCommand(StringM-^OÀ»actionCommand)
method in the Timer class.
CUSTOMER SUBMITTED WORKAROUND :
Subclass the Timer, add some actionCommandLike property. In the actionPerformed check if the runtime class of the event source is your Timer-subclass, than cast and get the value of the property.
(Incident Review ID: 209280)
======================================================================
###@###.### 10/12/04 18:20 GMT
A DESCRIPTION OF THE REQUEST :
When javax.swing.Timer fires an ActionEvent it sets its actionCommand to null. There is no way to change the value of and actionCommand during the life of an ActionEvent. I think it would be good to have the following constructor:
Timer(int delay, ActionListener listener, String actionCommand)
which will allow to set an actionCommand value of the ActionEvents fired by the Timer.
JUSTIFICATION :
1. An actionCommand is a property of ActionEvent and there should be a possibility to set this property when the event objects are generated by the Timer.
2. An actionCommand can be used to easily distinguish between event sources.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Implement the constructor:
Timer(int delay, ActionListener listener, String actionCommand)
and
public void setActionCommand(StringM-^OÀ»actionCommand)
method in the Timer class.
CUSTOMER SUBMITTED WORKAROUND :
Subclass the Timer, add some actionCommandLike property. In the actionPerformed check if the runtime class of the event source is your Timer-subclass, than cast and get the value of the property.
(Incident Review ID: 209280)
======================================================================
###@###.### 10/12/04 18:20 GMT