// Mainframe class that extends Frame // Date: 3-9-99 // Give applet access to all the AWT toolkit libraries import java.awt.*; import java.awt.event.*; public class topicfrm extends Frame implements ActionListener, ItemListener, MouseListener{ // declare variables private CheckboxGroup radios; private Checkbox radioItem1; private Checkbox radioItem2; public int imageRow = 0; public int imageCol = 0; public mainframe parent; // constructor with user interaction components public topicfrm (String s, mainframe ref){ super (s); // call base class constructor to set frame title parent = ref; addMouseListener (this); addWindowListener (new closewindow()); setBackground (Color.black); //add radio button panel setLayout (new BorderLayout()); Panel p = new Panel(); p.setBackground (Color.lightGray); p.setLayout (new GridLayout(2,1)); //define radio buttons radios = new CheckboxGroup(); radioItem1 = new Checkbox ("General History", radios, true); radioItem2 = new Checkbox ("Architectural Definitions", radios, false); radioItem1.addItemListener(this); radioItem2.addItemListener(this); //add to panel and place panel p.add (radioItem1); p.add (radioItem2); add ("Center",p); } public void paint (Graphics g) //paints the correct image in the mainframe { g.setColor (Color.black); } public void mousePressed (MouseEvent e){} public void mouseClicked (MouseEvent e) {} public void mouseEntered (MouseEvent e) {} public void mouseExited (MouseEvent e) {} public void mouseMoved (MouseEvent e) {} public void mouseReleased (MouseEvent e) {} public void actionPerformed (ActionEvent e) {} public void itemStateChanged (ItemEvent e) { if (e.getSource() == radioItem1){ imageRow = 0; parent.update (imageRow); } else if (e.getSource() == radioItem2){ imageRow = 1; parent.update (imageRow); } } }