Search code examples
javaswingbuttontooltipmouseevent

Java swing - button's note when the mouse touches it


I am trying to add a kind of label when the mouse touches a button, I used Jlabel but i failed to create it.

Can you help me?


Solution

  • Use setToolTipText with Button.

     button.setToolTipText("Click me");
    

    Look at this tutorial.