Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet

 
Arun Maalik
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir As we know that in paint method(Which is method of component class ) we declare a refrence of Graphics class like paint(Graphics g). By this g How do we call the method of Graphics class like g.draString(). Although g herer is not a object. Pls sugest me.

with regard
Arun Kumar maalik
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"g" is most certainly an object. Java itself (or more properly, the thread in the JVM dedicated to painting the screen and handling GUI events) will call your paint() method, passing a Graphics object as an argument.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic