Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Applet: right align y coordinate labels

Posted on 1998-12-16
3
Medium Priority
?
326 Views
Last Modified: 2006-11-17
I have a graphic image http://www.clearsail.net/~robjay/Graph10Applet.htm
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.
0
Comment
Question by:robjay
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
heyhey_ earned 200 total points
ID: 1229624
i don't know what is your current code -
- do you use some LayoutManager,
- do you use Label components
  or
- 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
add(labelXY);

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
  heyhey
0
 

Author Comment

by:robjay
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?
Thanks!
0
 

Author Comment

by:robjay
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?
Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

885 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