// Allison Obourn, CSE 142 // Demonstrates the basics of using graphics. import java.awt.*; public class GraphicsDemo { public static void main (String[] args) { DrawingPanel p = new DrawingPanel(400, 300); Graphics g = p.getGraphics(); g.drawLine(20, 20, 40, 40); g.drawOval(40, 40, 80, 120); g.drawRect(40, 40, 80, 120); g.setColor(Color.CYAN); g.fillRect(160, 160, 80, 80); g.setColor(Color.BLACK); g.drawRect(160, 160, 80, 80); } }