• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to remove space around JSeparator

 
Andrew Keidel
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JSeparators to draw lines between some panels in my GUI. I don't want to use borders because I only want lines between components, not completely around them (i.e., no lines around the outside edges of the GUI).
The problem I'm having is this:
With the preinstalled L&Fs (which I want to use), the horizontal JSeparator has empty space on either side of the line (not the case for the vertical JSeparator). I want to be able to draw a vertical line that goes right up to the horizontal line (touching it). However, a vertical JSeparator can't touch the horizontal JSeparator because of the hidden space surrounding the horizontal line.
A visual example:
I want to do this:
_________
|
| (vertical line meets horizontal one)
|
|
But I can only do this:
_________
<-- (I DON'T WANT THIS SPACE HERE)
|
|
|
|
I want the vertical JSeparator to come right up and meet the horizontal one! Ideas?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you should make some custom borders...

All you have to do is extend the interface javax.swing.border.Border and call setBorder( new MyCustomBorder() )...

-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic