// CS102, U of C, Spring 2006 import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.LinkedList; import java.util.Random; /* Note the following differences between this Applet and the Shuffler * GUI we built in class: * - this class extends the JApplet class * - there are all the same GUI components here except for the JFrame mainFrame * - what happened in the GUI constructor now happens in init() * - rather than add the mainPanel to the mainFrame, we add it to "this" * - there is no constructor * - there is no main method * * Please note however that in "all the ways that count" this applet is just * the same as the standalone GUI. * * To include this applet on a web page, put the compiled file ShufflerApplet.class * in the same directory as the following web page: *
... * * */ public class ShufflerApplet extends JApplet implements ActionListener { // GUI components private JButton enterButton; private JButton shuffleButton; private JButton resetButton; private JTextField tf; private JLabel names; private JPanel subPanel; private JPanel mainPanel; // logical private LinkedList