The Quintessential Drawing Program This example creates a frame and draws an oval within the frame. import java.awt.*; import javax.swing.*; class BasicDraw extends JComponent { public void paint(Graphics g) { Graphics2D g2d = (Graphics2D)g; g2d.drawOval(0, 0, getSize().width-1, getSize().height-1); } public static void main(String[] args) { JFrame frame = new JFrame(); frame.getContentPane().add(new BasicDraw()); int frameWidth = 300; int frameHeight = 300; frame.setSize(frameWidth, frameHeight); frame.setVisible(true); } }