Q:

How to remove the box surrounding the text inside a JButton?

this image shows the box
When I run JFrame a small box is surrounding the text in the focused JButton (See the picture attached)
How can I remove that box?

A:

This property is called focusPainted and you can disable it by:
jbutton.setFocusPainted(false);

