Nirav Kamani
Nirav Kamani

Reputation: 3272

JButton when clickedl leaves some border around text

I am having one simple form i created using JFrame.

In which i used one small JButton in which i set text only "X", now the problem is that when i press that button some border appears around the text which should not appear.

So, how can i resolve it?

How can i remove this border.I mean to say when the user clicks then also it should not show this border.enter image description here

Here Try to look at the button at the corner with red background.

Upvotes: 3

Views: 1788

Answers (1)

kiheru
kiheru

Reputation: 6618

Looks like a keyboard focus indicator. If you want that never appear call setFocusable(false) for that button.

Upvotes: 3

Related Questions