Message1708
Interactive mode Screenshot shown below:
C:\>jython
Jython 2.2rc1 on java1.6.0_01
Type "copyright", "credits" or "license" for more information.
>>> import javax.swing
>>> def note_check(e):
... pass
...
>>> xbox = javax.swing.JCheckBox("Chocolate Cake",itemStateChanged=note_check)
>>>
>>> def select_jc_item(e):
... pass
...
>>> jc = javax.swing.JComboBox(["Harry", "Sally", "Turtle"], actionPerformed=sel
ect_jc_item)
Traceback (innermost last):
File "<console>", line 1, in ?
TypeError: can't assign to this attribute in java instance: actionPerformed
>>>
It appears that I can assign a function to the itemStateChanged attribute of a JCheckBox, but I
cannot assign a function to the actionPerformed
attribute of a JComboBox. I have no idea why, but it is
rather frustrating. I think of it as a bug. Perhaps
you view it as a "feature". Any help / suggestions
will be appreciated as currently I am stuck.
dennisne@gmail.com
dln@andrew.cmu.edu
|
|
Date |
User |
Action |
Args |
2008-02-20 17:17:53 | admin | link | issue1749824 messages |
2008-02-20 17:17:53 | admin | create | |
|