JFrame f = new JFrame("Cubic");
CubicPanel cubicPanel = new CubicPanel();
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});
JApplet applet = new Cubic();
f.getContentPane().add(applet, BorderLayout.CENTER);
applet.init();
f.setSize(new Dimension(350,250));
f.setVisible(true);