import java.awt.*; import javax.swing.*; public class Main extends JFrame { public static void main(String[] arg) { new Main(500, 500); } public Main(int width, int height) { // Grab the container. Container c = getContentPane(); c.setLayout(new FlowLayout()); // Create the Mandelbrot viewing panel. ViewPanel viewPanel = new ViewPanel(width, height); viewPanel.setSize(width, height); viewPanel.setPreferredSize(new Dimension(width, height)); viewPanel.setBackground(Color.BLACK); // Add and display panel. c.add(viewPanel); setSize(width, height); setVisible(true); setDefaultCloseOperation(EXIT_ON_CLOSE); } }