import java.awt.*; import java.awt.image.*; public class Graphics0 { static public void main(String[] args) { final int YELLOW = 0xFFFF00; // Color code for yellow /* ------------------------------------------------ Preparing to draw picture... ------------------------------------------------ */ Frame f = new Frame( "My image" ); // Create a Frame Canvas pic = new MyCanvas(); // Make a 300x300 canvas f.add("Center", pic); // Put the canvas in the window f.setSize(400,300); // Set window size f.setVisible(true); // Make window visible /* ------------------------------------------------------- Now we are ready to draw things... For starters, let's draw a DOT at position (200,100) ------------------------------------------------------- */ MyCanvas.Image.setRGB(200, 100, YELLOW); // Put dot at pos (200,100) pic.repaint(); // Repaint the picture } }