How to remove the text border in a component?

Asked

Viewed 462 times

1

I have a program in Java and would like to remove these borders that appear in the button text:

imagem

(The red edges were in the issue the ones I want to remove are those dark blue ones inside the red ones)

2 answers

1

You can remove as the Renan spoke, but will be without the references of phocus to access the buttons with the tab and the space bar for example.

setFocusable(false);

0


Define Component#setFocusable() with false causes this border around the text to be removed. In fact this is indicative that the component is in focus.

JButton foo = new JButton();
foo.setFocusable(false);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.