Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CodeBarn - How does "Shapes" work?

 
mike vessey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Shapes example code (http://www.javaranch.com/CodeBarn/shapes.jsp) 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?
Thanks
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The statement

setVisible( true );

causes paint() to be called.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic