void (String[] args) { final JFrame frame = new JFrame(); frame.getContentPane().setLayout(new BorderLayout()); final JPanel content = new JPanel(new FlowLayout(FlowLayout.CENTER)); frame.getContentPane().add(content, BorderLayout.CENTER); content.add(new Painter("TOP", new ShapeTransform.Top())); content.add(new Painter("LEFT", new ShapeTransform.Left())); content.add(new Painter("BOTTOM", new ShapeTransform.Bottom())); content.add(new Painter("RIGHT", new ShapeTransform.Right())); frame.setBounds(300, 300, 300, 300); frame.show(); }