-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTicTacToeControlPanel.java
More file actions
32 lines (28 loc) · 977 Bytes
/
Copy pathTicTacToeControlPanel.java
File metadata and controls
32 lines (28 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//package TicTacToeLab;
import javax.swing.JButton;
import javax.swing.JPanel;
import java.awt.event.*;
public class TicTacToeControlPanel extends JPanel {
private JButton m_okButton;
private JButton m_cancelButton;
private TicTacToeFrame m_parent;
public TicTacToeControlPanel (TicTacToeFrame parent) {
m_parent = parent;
m_okButton = new JButton("Ok");
m_okButton.addActionListener(new ActionListener(){
public void actionPerformed (ActionEvent evnt) {
//set the replay
m_parent.tPanel.resetBoard();
}
});
add(m_okButton);
m_cancelButton = new JButton("Cancel");
m_cancelButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evnt) {
//set the end...
System.exit(-1);
}
});
add(m_cancelButton);
}
}