Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Space between Border and  a Component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Space between Border and  a Component" Watch "Space between Border and  a Component" New topic
Author

Space between Border and a Component

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
I had written a panel which consists of three Buttons and I had set a border for it. When I executed I found there is no space between the Border and the Button Component. What method should I add to have some space between the right and left side of the button and the border.



Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
I think you do this using the components insets. So call something like:

You should do this after setting the border on the component.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
If that fails, use a CompoundBorder, with an EmptyBorder as the inner border.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Space between Border and a Component
 
Similar Threads
Getting reference
Help writting to file
Position 5 buttons with GridBagConstraints in Swing
why no border around the button !!
JTabPane Problem