import java.awt.*; /* displays a frame with a textarea to show the moves of the computer player to the human user. It is only displayed by a computer player. After twenty lines the textarea is cleared to keep the window from getting too full. */ public class CompWindow extends Frame { private TextArea out; private int count = 0; public CompWindow () { super("Computer Player Information"); this.setLayout (new BorderLayout()); out = new TextArea (); out.setEditable(false); this.add("Center", out); this.resize (400, 150); this.show(); } public void setText (String str) { out.appendText(str + "\n"); count++; if (count >= 20 ) { count = 0; out.setText(str + "\n"); } } }