Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2004

Tip: Looking for answers? Try searching our database.

How to write character/string in an arbitrary direction in Swing?

Thread view: 
King W.Wang - 12 Mar 2004 19:11 GMT
Hi all gurus,
how can characters/strings be painted in an arbitrary angle/direction,
just as sometimes in a map? for example from left lower corner to
right upper corner. Thanks.

k.w. wang
Steve W. Jackson - 12 Mar 2004 19:52 GMT
>:Hi all gurus,
>:how can characters/strings be painted in an arbitrary angle/direction,
>:just as sometimes in a map? for example from left lower corner to
>:right upper corner. Thanks.
>:
>:k.w. wang

You'll probably want to get familiar with the Java2D APIs.  Graphics2D
is what's most often used in Swing (even though most methods involved in
painting, etc., say Graphics, most actually use Graphics2D).  Then,
you'll need to get familiar with the AffineTransform that's used to
scale, rotate, etc.  When you want to use drawString() on a Graphics or
Graphics2D object, the current color, rotation, scaling, etc., all come
into play -- all derived from an AffineTransform -- to do the drawing.

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.