Type | Name | Details |
---|---|---|
JButton | startNewGameButton | "Start New Game" |
JButton | makeComputerPlayButton | "Make Computer Play" |
JPanel | board | 3 by 3 grid layout manager |
Jlabel | message | "Push Start New Game button." |
In the applet init() method, first disable makeComputerPlayButton. Then create a JPanel with a 1 by 2 grid layout manager for the two buttons. Install the two buttons into this panel. Use a BorderLayout as a layout manager for the applet. Install buttonPanel, board, and message as the north, center, and south components of the applet.
After you have created the two files, compile your TicTacToe class and run the applet with appletviewer. Your applet should look like the following demonstration applet.