This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to diplay x sup y on JLabel?

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Thanks man
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic