Solved

Applet: right align y coordinate labels

Posted on 1998-12-16
3
301 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 50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
This video teaches viewers about errors in exception handling.

861 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