
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.


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.

