//Purpose: This applet has buttons that when hit pops-up a // new window (frame) that displays registration information // to user. import java.awt.*; import java.applet.*; import java.awt.event.*; import java.awt.event.ActionListener; public class test15 extends Applet implements ActionListener { Frame pop_up; Button register, end; String[] reg_info = {"Magazine Registration Info", " ", "You can register by calling 1-800-555-1234", "Please have your visa number ready" }; //create main applet panel info. public void init() { Panel main_panel = new Panel(); register = new Button("Register"); end = new Button("End Registration"); register.setSize(80,40); end.setSize(80,40); setBackground(Color.yellow); setLayout( new BorderLayout()); //Set up info to add to north of applet BorderLayout setFont(new Font("Times Roman", Font.BOLD, 12)); add("North", new Label("Magazine Registration Site", Label.CENTER)); //Set up main panel to be added to center of applet BorderLayout main_panel.setLayout(new GridLayout(1,2)); main_panel.add(register); main_panel.add(end); add("Center", main_panel); //Set up info to add to south of applet BorderLayout setFont(new Font("Times Roman", Font.ITALIC, 10)); add("South", new Label("Thank you for visiting", Label.CENTER)); //register this applet as an ActionListener for each button register.addActionListener(this); end.addActionListener(this); //create pop-up window frame with registration info in it pop_up = new Frame("Registration Window"); pop_up.setLayout(new GridLayout(reg_info.length+1, 1)); pop_up.add(new Label(reg_info[0], Label.CENTER)); for(int i=1; i