Space between JPanel and JLabel

Posted on 2003-02-24
Medium Priority
Last Modified: 2006-11-17
How can I make a space between JPanel and the J-components that I place in it.

And how can I also make spaces between them??

Mostly I get the components against each other.
Question by:RdeLange
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 8010880
What layout are you  using?  Check out BoxLayout, I think they have seperators.  This is a swing layout.  

Author Comment

ID: 8010894
I mostly use the borderlayout

Accepted Solution

yongsing earned 100 total points
ID: 8013353
If you use BorderLayout, then you can use BorderLayout.setHgap() and BorderLayout.setVgap() to set the gaps between the components.

Expert Comment

ID: 8054439
Why a C grade? If you're not satisfied with the answer, then you should tell us why.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question