import java.applet.*; import java.awt.*; class waveFrame extends Frame { private Applet m_appletParent; private Label line1,line2,line3, line4,line5,line6,line7; waveFrame(Applet appletParent) { super("Wavelength"); m_appletParent = appletParent; setLayout(new GridLayout(7,1,0,0)); line1 = new Label("The wavelength is the distance "); line2 = new Label("between equivalent points on "); line3 = new Label("the wave. This is illustrated "); line4 = new Label("by the two surfers who move "); line5 = new Label("along always exactly one "); line6 = new Label("wavelength apart, on the same "); line7 = new Label("part of the wave. "); add(line1); add(line2); add(line3); add(line4); add(line5); add(line6); add(line7); } public boolean handleEvent(Event e) { Object ob; if (e.id == Event.WINDOW_DESTROY) { ob = "w"; m_appletParent.action(e,ob); return true; } else { return super.handleEvent(e); } } } class freqFrame extends Frame { private Applet m_appletParent; private Label line1,line2,line3, line4,line5,line6,line7,line8; freqFrame(Applet appletParent) { super("Frequency"); m_appletParent = appletParent; setLayout(new GridLayout(8,1,0,0)); line1 = new Label("The frequency is number of "); line2 = new Label("waves that pass a given point "); line3 = new Label("in unit time. This is shown "); line4 = new Label("by the seated surfer who bobs "); line5 = new Label("up and down as the waves pass. "); line6 = new Label("The frequency in Hertz is the "); line7 = new Label("number of time he does this "); line8 = new Label("in one second. "); add(line1); add(line2); add(line3); add(line4); add(line5); add(line6); add(line7); add(line8); } public boolean handleEvent(Event e) { Object ob; if (e.id == Event.WINDOW_DESTROY) { ob = "f"; m_appletParent.action(e,ob); return true; } else { return super.handleEvent(e); } } }