Oh yeah :)
Type: Posts; User: TP-Oreilly
Oh yeah :)
As an ActionListener is an interface, how can i add an instance of this? Because interfaces cant be instantiated can they.
... i am adding the method actionPerformed to the fileItem object, and whenever an action occurs on this object the actionPerformed method is called?
I know that :), i couldnt be bothered to write it all out. So by writing:
"fileItem.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
code....
}...
So when I do "fileItem.addActionListener(new ActionListener(){});", I am adding a method named "actionPerformed" to the fileItem object?
Ahh I get what your saying.
I have looked up interfaces. Are interfaces similar to classes except they they only contain empty methods?