• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

graphics beginner

 
preethi george
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a really silly problem.. but i cant get any help..

i need to initialize a graphics object.. the javadocs mentions create();
cant get it to work and faces a compilation error : cannot find symbol();
could any one tell me the correct syntax??
Graphics g = ??? ;
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't create Graphics objects; AWT/Swing creates them, and then provides them to your code in appropriate places, such as inside of paint or paintComponent methods. You may want to work through the chapter on custom painting in the Sun Java Tutorial.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49849
70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is a Swing-related question I shall move it to the Swing forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic