From: Jeff E. <je...@ad...> - 2002-04-09 15:27:47
|
JList doesn't support ActionListener, so the bean property magic of assigning to actionPerformed can't work. JList does support ListSelectionListeners. ListSelectionListener has a valueChanged method, so you should be able to assign to valueChanged on the JList. self.jlist = swing.JList(valueChanged=self.onefileselection) Jiger Patel wrote: > Hi all, > I am writting a script in Jython which uses swing etc in it. I am > creating a JList object & assigning actionPerformed to it but jython > gives me this error. > > TypeError: can't set arbitrary attribute in java instance: > actionPerformed > > My code creating the jlist obj is like this > > self.jlist = swing.JList(actionPerformed=self.onefileselection); > > & onefileselection is defined in the same class like this > > def onefileselection(self,event): > self.openFile(self,event.source.selectedValue); > > I dont see anything wrong & infact if I assign the same > actionPerformed syntax to a JTextField it works fine. But not with JList > or JComboBox etc. > > Is there anything am missing. > > > Thanks & Awaiting your replies, > Jiger > > > > _________________________________________________________________ > Join the world's largest e-mail service with MSN Hotmail. > http://www.hotmail.com > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |