开发者

mouse listener event

开发者 https://www.devze.com 2022-12-28 07:24 出处:网络
I have got a program having an array of button开发者_如何学Gos, each of these button has their mouselistener event.

I have got a program having an array of button开发者_如何学Gos, each of these button has their mouselistener event.

Now, how can i find which of the buton is clicked through the mouse listener.


The usual way to respond to buttons is via an ActionListener, as discussed in How to Use Buttons. This example uses both individual and common listeners to implement a keypad. If you are actually using a MouseListener to locate components, findComponentAt(int x, int y) may be useful, as shown here.

0

精彩评论

暂无评论...
验证码 换一张
取 消