23 lines
684 B
Java
23 lines
684 B
Java
import javax.swing.*;
|
|
|
|
public class Display {
|
|
public static void main(String[] args) throws Exception{
|
|
//creating instance of JFrame
|
|
int boardWidth = 400;
|
|
int boardHeight = 400;
|
|
|
|
JFrame game = new JFrame();
|
|
game.setSize(boardWidth, boardHeight);
|
|
game.setVisible(true);
|
|
game.setLocationRelativeTo(null);
|
|
game.setResizable(false);
|
|
|
|
Chess chess = new Chess(boardWidth, boardHeight);
|
|
game.add(chess);
|
|
game.pack();
|
|
chess.requestFocus();
|
|
}
|
|
}
|
|
|
|
|
|
//images : https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQN6qOyhiUDLlTlwl19PaMTeiY5rSOqkUqu-g&s |