View Single Post
  #1 (permalink)  
Old 02-05-2008, 02:38 AM
diRisig diRisig is offline
Member
 
Join Date: Feb 2008
Posts: 6
diRisig is on a distinguished road
New: Want to understand Drawing...
Hello,

I'm trying to get into java coming from C# and C++. And I want to understand paint() events of awt components.

I have a jFrame which has a Canvas and a jButton. I've put this code in the button's clicked event method but i don't get anything drawn on the canvas. How do I draw to a canvas? please

Code:
Graphics g = canvas1.getGraphics(); g.setColor(Color.BLACK); g.fillRect(0, 0, canvas1.WIDTH, canvas1.HEIGHT);
Reply With Quote
Sponsored Links