Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes How to diplay x sup y on JLabel? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How to diplay x sup y on JLabel?" Watch "How to diplay x sup y on JLabel?" New topic
Author

How to diplay x sup y on JLabel?

qunfeng wang
Ranch Hand

Joined: Jan 28, 2005
Posts: 407
I create my own SupLabel extends JLabel and override its paintComponent method. I use the HTML to draw what I want. But it just draws the plain html string! Below is my code. Anyone sheds some light on me? Thanks.


To be or not to be. It's a question.
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
But JLabel is already capable of painting HTML text, you do not need to redefine the paint method.

It is as simple as



Is it not?
[ October 23, 2006: Message edited by: Edwin Dalorzo ]
qunfeng wang
Ranch Hand

Joined: Jan 28, 2005
Posts: 407


Thanks man
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to diplay x sup y on JLabel?
 
Similar Threads
Help! Having trouble animating translucent window.
Messagebox with Mouseevent
How to use JSlider to adjust Text in a JPanel
Enter # in JTextField, draw = # ovals, use JBottons to color ovals???
looking for a graphical representation