/* * This software is distributed as-is with no warranty of any kind and I accept no responsibility * for its use. You may use this software however you wish, just give me credit. * * Mike Cynn (http://mike.cynn.com/applets/pascal/PascalTriangleSwing.java) */ import javax.swing.JApplet; import javax.swing.SwingUtilities; import javax.swing.*; public class PascalTriangleSwing extends JApplet { //Called when this applet is loaded into the browser. public void init() { //Execute a job on the event-dispatching thread; creating this applet's GUI. try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { createGUI(); } }); } catch (Exception e) { System.err.println("createGUI didn't complete successfully"); } } private void createGUI() { //Create and set up the content pane. PascalPanel newContentPane = new PascalPanel(); newContentPane.setOpaque(true); setContentPane(newContentPane); } } // end class