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
Graphics g = canvas1.getGraphics();
g.setColor(Color.BLACK);
g.fillRect(0, 0, canvas1.WIDTH, canvas1.HEIGHT);