How to get mouse events.

I’m writing a custom Button class and I can’t figure out how to get mouse clicks and what not. I’m used to just being able to add a MouseAdapter to a JComponent >_<. Also if your wondering why I’m writing my own class it’s because right now I just draw an image, some text and then just check if the a mouse click is in the image bounds. It’s very unorganized so I’m trying to clean it up.

What are you drawing on if not a JComponent?

Oh… >_< thanks you just reminded me how to do it… I was trying to handle the mouse listener inside the Button class… I’m drawing on a Canvas by the way.

Cool, glad to help.