Browse Source

New TicTacToeGame Class added

remotes/origin/develop
fdai6040 2 years ago
parent
commit
3f762280ce
  1. 3
      src/main/java/src/Main.java
  2. 45
      src/main/java/src/TicTacToeGame.java

3
src/main/java/src/Main.java

@ -16,6 +16,9 @@ public class Main {
TasksFrame tasksFrame = new TasksFrame();
tasksFrame.run();
TicTacToeGame toeGame = new TicTacToeGame();
}
});
}

45
src/main/java/src/TicTacToeGame.java

@ -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) {
}
}
Loading…
Cancel
Save