Search code examples
javaswingjlabelmouseovermouse-cursor

How to make a JLabel clickable?


I want to customize a JLable to make him clickable, i'm not talking about adding an Action Listener because i already have, i'm talking about changing the mouse cursor's reaction when the JLabel gain Focus just like the reaction of a mouse hoover on a link in the browser.

enter image description here

I have impression that is not possible with swing.


Solution

  • How about:

    label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));