Applet: right align y coordinate labels

Posted on 1998-12-16
Last Modified: 2006-11-17
I have a graphic image
I would like to right align the y coordinate labels - I am
somewhat familiar with the Label.RIGHT method but I'm unsure
how to implement.
Question by:robjay
  • 2
LVL 16

Accepted Solution

heyhey_ earned 50 total points
ID: 1229624
i don't know what is your current code -
- do you use some LayoutManager,
- do you use Label components
- you paint everything yourself ...

in case you use Label components, here is the appropriate code

labelXY = new Label("X,Y :",Label.RIGHT);
labelXY.setBounds(440,400,60,24); // will align the label at position 500

if you paint the text in your paint method, you'll have to make all computations yourself.

if you still have problems, please post the appropriate code.

hope this helps

Author Comment

ID: 1229625
Actually I paint everything - could you briefly explain the "computations" a bit.  I assume I can still utilize the labelXY = new Label("X,Y :",Label.RIGHT); code?

Author Comment

ID: 1229626
Actually I paint everything - could you briefly explain the "computations" a bit.  I assume I can still utilize the labelXY = new Label("X,Y :",Label.RIGHT); code?

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 50
splitOdd10 challenge 5 104
eclipse java  build path 6 56
windows explorer path to command prompt 5 43
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now