import java.awt.*; import java.awt.event.*; public class WrittenBy extends java.applet.Applet implements ActionListener { TextField m0, g0, m1, m2; Button b1; String author; void Byline2(String name) { m1.setText("This program was written by"); m2.setText(" " + name); } String GetName() { String name; name = g0.getText(); return name; } public void init() { m0 = new TextField(80); m0.setText("Enter author below and press button."); g0 = new TextField(80); m1 = new TextField(80); m2 = new TextField(80); b1 = new Button("button"); add(m0); add(g0); add(b1); add(m1); add(m2); b1.addActionListener(this); } public void actionPerformed(ActionEvent event) { author = GetName(); Byline2(author); } }