This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes CodeBarn - How does Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "CodeBarn - How does "Shapes" work?" Watch "CodeBarn - How does "Shapes" work?" New topic

CodeBarn - How does "Shapes" work?

mike vessey

Joined: Nov 09, 2002
Posts: 2
In the Shapes example code ( how does the paint method get called?
The main method instantiates a new ShowShapes object, which seems to have a constructor method that just sets up a window and makes it visible. From where is the paint method called?
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9044
The statement

setVisible( true );

causes paint() to be called.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: CodeBarn - How does "Shapes" work?
Similar Threads
JavaRanch CodeBarn now has Servlet and JSP examples
JavaRanch CodeBarn now has Servlet and JSP examples
class casting
SortNames woes...