It's not a secret anymore!
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
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: 9059
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?
It's not a secret anymore!