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.

Drawing HTML JLabels on Graphics

Thread view: 
Karsten Wutzke - 29 Feb 2004 13:07 GMT
Hi all!

I'm currently successfully drawing a graph and strings onto a Graphics2D
object. However, the strings contain indices, like w1(x) or TA1, where
the numbers are displayed as subscipts (HTML <sub> tag). I use this sub
tag for creating JLabels, so in any other GUI, the indices appear lowered.

Now the question is:

How do I create the same effect for a Graphics2D object?

Is there any way to make use of the JLabels HTML rendering code?

Thanks for helping!

Karsten Wutzke
ak - 29 Feb 2004 23:31 GMT
> I'm currently successfully drawing a graph and strings onto a Graphics2D
> object. However, the strings contain indices, like w1(x) or TA1, where
[quoted text clipped - 6 lines]
>
> Is there any way to make use of the JLabels HTML rendering code?

paint JLabel with HTML to your Graphics2D.
--

____________

http://reader.imagero.com the best java image reader.
Karsten Wutzke - 01 Mar 2004 12:58 GMT
>>I'm currently successfully drawing a graph and strings onto a Graphics2D
>>object. However, the strings contain indices, like w1(x) or TA1, where
[quoted text clipped - 9 lines]
> paint JLabel with HTML to your Graphics2D.
> --

Yep, that's what I thought of. But how do I use it? Which method do I
use? I looked in the docs, but I couldn't find anything like
Graphics2D.drawComponent(label) or such.

Karsten
ak - 01 Mar 2004 16:02 GMT
> Yep, that's what I thought of. But how do I use it? Which method do I
> use? I looked in the docs, but I couldn't find anything like
> Graphics2D.drawComponent(label) or such.
>
> Karsten

lol,

not Graphics2D.drawComponent(label),
but

JLabel.paintComponent(Graphics g); //preferred method
or JLabel.paint(Graphics g); // if you really know what you doing

--

____________

http://reader.imagero.com the best java image reader.


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.