Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JLabels on one line

843805Feb 9 2007 — edited Feb 9 2007
I have 3 JLabels which are rapidly updated with new data (numbers). I want tot add the three labels on one line (horizontally) and don't want them to move when the numbers change. Whatever layout I use they always move when the length of the numbers change. I also tried using \t and only using one label, but that also doesn't work.

Example (what is supposed to happen):
Number 1: 550 Number 2: 400 Number 3: 56156165
Number 1: 5 Number 2: 4 Number 3: 56

What happens now (I'm using borderlayout and added one to west, center, east)
Number 1: 550 Number 2: 400 Number 3: 56156165
Number 1: 5 Number 2: 4 Number 3: 56

It seems like such an easy problem, but after a lot of trying I can't figure it out.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2007
Added on Feb 9 2007
2 comments
116 views