How to remove strange border on JTextArea

I have a JTextArea, a Jlist and a few more things on my JPanel, the JTextArea seems to put this weird border around the right and bottom of the TextArea.

I tried to use textArea.setBorder(BorderFactory.createLineBorder(Color.black, 2));

To get rid of it

This adds a black border as expected, but I still get a weird border. Here is a photo.

Weird Border

Weird Border 2

I cannot remove the white and gray border with a textbox

I have a border layout with 5 pixel spacing both vertically and horizontally.

Edit I don't think I said that correctly. White and gray "borders" exist even when I don't add.setBorder()

+3


source to share


1 answer


You see the border of yours JTextArea

and JScrollPane

, try removing the border of your scroll, something like the following code:

jScrollPane1.setBorder(null);

      

You will get from this:

enter image description here



:

enter image description here

Note that the white line only disappeared from JTextArea

. Is this what you are looking for?

+2


source







All Articles