File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to remove space around JSeparator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to remove space around JSeparator" Watch "How to remove space around JSeparator" New topic
Author

How to remove space around JSeparator

Andrew Keidel
Greenhorn

Joined: Dec 06, 2001
Posts: 27
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

Joined: Oct 18, 2000
Posts: 4121

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


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to remove space around JSeparator