• Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt in AWTEventMulticaster

 
shihab K Bava
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

When gothru the AWTEventMulticaster's mouseClick function I found that mouseClicked is fired two times. Colul anybody please explain why this is for? Please refer below code.

<Code>
/**
* Handles the mouseClicked event by invoking the
* mouseClicked methods on listener-a and listener-b.
* @param e the mouse event
*/
public void mouseClicked(MouseEvent e) {
((MouseListener)a).mouseClicked(e);
((MouseListener)b).mouseClicked(e);
}
</Code>

I have a JTable and added a mouse listener to that. When I click on the table, the mouseClick function fires two times. Could any body please help?

Thanks and Regards
Shihab
 
Suraj Chandran
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing that seems most probable to me is that by misake you have added the listener twice
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shihab, you should use [ and ] instead of < and > for code tags. See Use Code Tags.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!