Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Panel and JLabel distance

Posted on 2003-03-14
5
Medium Priority
?
324 Views
Last Modified: 2012-08-13
I hava an JPanel with a JLabel in it. Is there a possibility to make the distance from the left and right sight bigger??

Now I find my text almost in the JPanel. And I do not want to make a extra space in my text
0
Comment
Question by:RdeLange
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Exceter earned 200 total points
ID: 8141468
Could you post your code?
What layout manager are you using in the JLabel?
If you have not specified one the default is FlowLayout with left justification. Try this,

panel1.setLayout( new FlowLayout( FlowLayout.CENTER ) );

This will center your label inside the panel, along with any other components inside the panel.

Exceter
0
 

Expert Comment

by:CleanupPing
ID: 9474538
RdeLange:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 8

Expert Comment

by:Exceter
ID: 9477408
Sidenote: "What layout manager are you using in the JLabel?" should have read: What layout manager are you using in the JPanel?

Due to the lack of feedback I think I should get the points.
0

Featured Post

Independent Software Vendors: 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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

571 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