|
|
@ -0,0 +1,45 @@ |
|
|
|
package src; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.event.*; |
|
|
|
import java.util.*; |
|
|
|
import javax.swing.*; |
|
|
|
|
|
|
|
public class TicTacToeGame implements ActionListener { |
|
|
|
JFrame frame = new JFrame(); |
|
|
|
JPanel t_panel = new JPanel(); |
|
|
|
JPanel bt_panel = new JPanel(); |
|
|
|
JLabel textfield = new JLabel(); |
|
|
|
|
|
|
|
|
|
|
|
// Creating class constructor |
|
|
|
|
|
|
|
TicTacToeGame() |
|
|
|
{ |
|
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
|
frame.setSize(300, 300); |
|
|
|
frame.getContentPane().setBackground(new Color(250, 184, 97)); |
|
|
|
frame.setTitle("Tic Tac Toe Game"); |
|
|
|
frame.setLayout(new BorderLayout()); |
|
|
|
frame.setVisible(true); |
|
|
|
|
|
|
|
textfield.setBackground(new Color(0,0,0)); |
|
|
|
textfield.setForeground(new Color(255,0,0)); |
|
|
|
textfield.setFont(new Font("Serif", Font.BOLD, 25)); |
|
|
|
textfield.setHorizontalAlignment(JLabel.CENTER); |
|
|
|
textfield.setText("Tic Tac Toe"); |
|
|
|
textfield.setOpaque(true); |
|
|
|
|
|
|
|
t_panel.setLayout(new BorderLayout()); |
|
|
|
t_panel.setBounds(0, 0, 800, 100); |
|
|
|
|
|
|
|
bt_panel.setLayout(new GridLayout(3, 3)); |
|
|
|
bt_panel.setBackground(new Color(0, 0, 0)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
} |
|
|
|
} |