Solved

Applet: right align y coordinate labels

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sumHeights  challenge 17 61
Receive file in Servlet 1 36
word0 challenge 4 53
recursion example 16 69
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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.
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.

758 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

21 Experts available now in Live!

Get 1:1 Help Now