import java.awt.*; import java.awt.event.*; /** TestC creates a frame containing a HangmanCanvas and two Buttons */ class TestC extends Frame { HangmanCanvas c; TestC() { addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); setSize(500,500); setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10)); c = new HangmanCanvas(); c.setSize(150,250); add(c); Button inc = new Button("Wrong Guess"); inc.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { c.addWrongGuess(); } }); add(inc); Button reset = new Button("Reset"); reset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { c.resetWrongGuesses(); } }); add(reset); } public static void main (String[] args) { TestC f = new TestC(); f.setVisible(true); } }