- Frecklefoot
"What you are good at is not as important as being good at something." --Robert B.Parker
Chris Baty wrote:Hi guys,
Does anyone know how to create a rollover for a custom drawn button? It's easy if you use Icon but mine is custom drawn. If I implement the mouselistener in the myButton class where do I add the listener. If I implement the listener in the JFrame class how does that class know only to redraw that button? I'm confused.
Any help would be appreciated.
Chris
Chris Nash wrote:Chris, Pete and I were telling you to do two different things. His suggestion is to extend JButton and implement your own paint routine. He says there is an isRollover() method you can call to check for rollover. In his case, you won't need a mouse listener.
Chris Baty wrote:It's easy if you use Icon but mine is custom drawn.