Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JLabel vs drawString

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which one is better for performance, JLabel or drawString? drawString is using Java2D, obviously. My hypothesis is JLabel. How much performance will I gain from moving from the worse one to the better one?
Thanks,
cc11rocks
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BUMP
 
Matthew Brown
Bartender
Posts: 4567
8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're more likely to get a useful response in the GUI forums, so I'll move this thread there.

Personal opinion though - I don't think performance is all that relevant. If a JLabel is appropriate it has all sorts of advantages regarding consistent look-and-fee, accessibility features, correct behaviour when used with layout managers compared to just drawing the string like a graphic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic