Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with drawing styled (attributed) text

 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the following two code excerpts. First of them works OK, but the second does not. Why? They are almost same.





What is the problem? Is it a bug?
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea???
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This works okay.
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it doesn't work. The string "1,2" is not subscripted.

Also, there is an error in the line:

astr.addAttribute(TextAttribute.SIZE, 36f);

It should be:

astr.addAttribute(TextAttribute.SIZE, new Float(36));
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic