try { String metal = UIManager.getCrossPlatformLookAndFeelClassName(); UIManager.setLookAndFeel (metal); } catch (Exception e) { e.printStackTrace(); } JFrame frame = new JFrame ("Anti-Aliasing demo"); frame.getContentPane().add (new JLabel ("Here are some shapes"), BorderLayout.NORTH); frame.getContentPane().add (new PrimPanel()); frame.pack(); frame.setVisible(true);
triangle = new Polygon(); triangle.addPoint (105, 95); triangle.addPoint (195, 95); triangle.addPoint (150, 5); new AntiAliasingDemo();