import javax.swing.JPanel; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.*; import java.awt.*; public class MyWorldView extends JPanel { public MyWorldView(MyWorld w){ world = w; } public void paintComponent(Graphics g){ Graphics2D g2 = (Graphics2D)g; super.paintComponent(g); // it paints the background g2.setStroke(new BasicStroke(0.02f)); } private MyWorld world; } // END declarations to use metric coordinate system (not pixels)