

add(obj): This function is used to add the component object in frame or panel.setIconImage(icon): This function is used to set the icon of the frame/window.It takes two parameters such as width and height. setSize(int width, int height): This function is used to set the size of frame, panel, etc.setBorder(BorderFactory.createLineBorder(code(“#2C6791”))): This function will set the border around the buttons, frames, panels, etc.setVisible(true): This function will set the frame/window to be visible to the user.setText(“your text”): This function will set the text of the label, button, etc.setLayout(layout): This function will set the layout of the frame or panel.setBackground(new Color(255,255,255)): This function will set the background color of the UI component.In this step, we basically create the user interface (UI) of our tic-tac-toe game, for that we use frames, panels, buttons, labels, etc. In this step, we will import AWT & Swing required packages import

Please download the full source code of tic-tac-toe java project: Tic Tac Toe Java Project Step to build Tic-Tac-Toe game using java:

By default, these packages are installed by java. Abstract Window Toolkit (AWT) & Swing packages are standard graphical user interfaces used to render graphics.To build a tic-tac-toe game using java we require basic knowledge of java.Java should be installed on the machine.
