• 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
Sheriff
Posts: 24215
37
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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!