I'm currently working on a project in Java Netbeans but I don't know how to add label in a button when hovered. It will look like this:
So when I hovered my cursor on a button it will show a label. Sorry if I can't show any code because I don't have any idea on how to implement it. Any ideas?
You can use setToolTipText
Example:
JButton button = new JButton("Click Me");
button.setToolTipText("Click this button to make something happen.");
Refer here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.