aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Space around my BorderLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Space around my BorderLayout" Watch "Space around my BorderLayout" New topic
Author

Space around my BorderLayout

Greg Funston
Ranch Hand

Joined: Feb 09, 2011
Posts: 81

Hello,

I have designed a GUI within a Jframe. It has a Borderlayout inside with 3 panels. A top panel a bottom panel and a center panel with a JScrollpanel. I like my GUI except for one thing. It goes all the way to the edge of my JFrame. Is there a simple way to have an inset or margin from the frame. I would appreciate any ideas.




Thanks.

Greg Funston SCJP
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

You can try setting an empty border around the component.
Check out BorderFactory#createEmptyBorder(int top,int left,int bottom,int right)


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Greg Funston
Ranch Hand

Joined: Feb 09, 2011
Posts: 81

Thanks



It was exactly what I was looking for. I saw it when I was looking through the API but had dismissed it
without realizing it was adjustable.

Cheers,
Greg Funston SCJP :
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Space around my BorderLayout
 
Similar Threads
Layout Problems
JScrollPane
JScrollPane
Updating a JPanel after change...
Out of Bounds Exception returns and the eradication thereof.