-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
22 lines (21 loc) · 1.15 KB
/
Copy pathMain.java
File metadata and controls
22 lines (21 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JToolBar;
/*******************************************************
* the main class of the program; where it is run from.
*******************************************************/
public class Main{
public static void main(String[] args) {
setUI(); // calls method to setup the user interface
}
public static void setUI(){ // method to set UI
JFrame f = new JFrame("Chess"); // new frame to house the UI
JToolBar tools = ChessBoard.toolbar(f); // create toolbar from 'chessboard' class
ChessBoard chessBoard = new ChessBoard(); // create chessboard object
f.add(tools,BorderLayout.PAGE_START); // add toolbar to frame
f.add(chessBoard); // add chessboard to frame
f.pack(); // pack frame components
f.setLocationRelativeTo(null); // ensure position
f.setVisible(true); // set frame visible
}
}