This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CodeBarn - How does "Shapes" work?  RSS feed

 
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: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The statement

setVisible( true );

causes paint() to be called.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!