import javax.swing.*; //import com.sun.java.swing.*; import java.awt.*; import java.applet.*; public class GraphApplet extends JApplet { JTabbedPane tabbedPane; GraphPanel graphPanel; TablePanel dataPanel; public void init() { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch(Throwable t) {System.out.println("howdy");} ImageIcon icon1 = new ImageIcon(getClass().getResource("images/mtable.gif")); ImageIcon icon2 = new ImageIcon(getClass().getResource("images/mgraph.gif")); tabbedPane = new JTabbedPane(); getContentPane().add(tabbedPane); Image iconIm1 = getImage(getClass().getResource("images/maddc.gif")); Image iconIm2 = getImage(getClass().getResource("images/maddr.gif")); Image iconIm3 = getImage(getClass().getResource("images/mcalc.gif")); Image iconIm4 = getImage(getClass().getResource("images/mclear.gif")); dataPanel = new TablePanel(iconIm1, iconIm2, iconIm3, iconIm4); tabbedPane.addTab("Data", icon1, dataPanel, "Enter data here"); tabbedPane.setSelectedIndex(0); graphPanel = new GraphPanel(dataPanel); tabbedPane.addTab("Graph", icon2, graphPanel, "View the plot of data"); tabbedPane.addChangeListener(graphPanel); } }