I am working my way through an online book--Intro to Java Programming by David Eck--and in it he says that it is generally considered bad style to use the getGraphics() method to draw outside of a component's paintComponent method. Does anyone know why this is?
pi_lord12
0
Light Poster
Recommended Answers
Jump to PostSince nobody more knowlegable has answered, here's my attempt.
Swing thinks that it is in charge of what gets painted when because it is responsible for calling the various paint methods. If you go ahead and do painting activities that Swing doesn't know are happenuing then either they won't make …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.