Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simplify the two listener - addMouseListener and addKeyListener

Status
Not open for further replies.

wangdong

Programmer
Oct 28, 2004
202
CN
The two listeners are doing a same job. Is there anyway to simplify these two listener?

Code:
aTable.addMouseListener(new java.awt.event.MouseAdapter() {
 public void mouseClicked(java.awt.event.MouseEvent e) {
	readTableLink();
 }
});
aTable.addKeyListener(new java.awt.event.KeyAdapter() {
 public void keyReleased(java.awt.event.KeyEvent e) {
	readTableLink();
 }
});

Chinese Java Faq Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top