aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JLabel vs drawString Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JLabel vs drawString" Watch "JLabel vs drawString" New topic
Author

JLabel vs drawString

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

BUMP
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4240
    
    7

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.
 
Don't get me started about those stupid light bulbs.
 
subject: JLabel vs drawString
 
Similar Threads
Setting JTree Row Components
quick gui question
Difference between String str = "" and String str = new String().
cache ejb
Messagebox with Mouseevent