Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

example program on java Inner class listener (xicl)

One good way to implement a listener is to define an inner class that implements ActionListener. An inner class has access to the outer class's fields, so can get work with components defined in an outer JFrame subclass.

  1
2
3
4
5
6
7
8
   
///////////////////////////////////////////////////////////////// ${Identifier}
class ${Identifier} implements ActionListener {
public void actionPerformed(ActionEvent e) {
//... Do something.
}
}

No comments:

Post a Comment

Archives