-2

I'm creating a text editor as my exam work and I have a main JPanel which all the Swing components are on. At the top I have a JMenuBar and in the center a JTextPane and at both sides I have panels that display images. The problem I have is that between the left side of the text pane and my right panel there is a weird line and I can't figure out how to get rid of it.

I have tried setBorderPainted to false on both my text pane and panel but that didn't work. In the first image there is a weird line between the text pane right side and the rights sides panel but not to the left panel.

weird line between jtextpane and jpanel - image

no line - image

The right side should look like the left side as shown in the second image.

Roshana Pitigala
  • 8,437
  • 8
  • 49
  • 80

1 Answers1

0

@MadProgrammer was correct when I added the jtextpane to the panel without the jscrollpane the line disappeard.

When I typed in jscrollpane.setBorder(null); the line disappeard.

Here is a screenshot of the application. !https://i.stack.imgur.com/fnXrR.jpg "fullscreen"