package Sorter; import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; public class SorterApplet extends JApplet { boolean isStandalone = false; private JButton startBtn = new JButton(); private JLabel jLabel1 = new JLabel(); //Get a parameter value public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } //Construct the applet public SorterApplet() { } //Initialize the applet public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { startBtn.setFont(new java.awt.Font("Dialog", 1, 30)); startBtn.setText("Click Here To Run Demo"); startBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { startBtn_actionPerformed(e); } }); this.setSize(new Dimension(400,300)); jLabel1.setText("Java 2 must be installed on your machine in order to run this applet!"); this.getContentPane().add(startBtn, BorderLayout.CENTER); this.getContentPane().add(jLabel1, BorderLayout.NORTH); } //Start the applet public void start() { } //Stop the applet public void stop() { } //Destroy the applet public void destroy() { } //Get Applet information public String getAppletInfo() { return "Applet Information"; } //Get parameter info public String[][] getParameterInfo() { return null; } //static initializer for setting look & feel static { try { //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch(Exception e) { } } void startBtn_actionPerformed(ActionEvent e) { (new Frame1(true)).show(); } }