formatting and compiling
This commit is contained in:
37
Display.java
37
Display.java
@@ -1,23 +1,24 @@
|
||||
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();
|
||||
}
|
||||
public static void main(String[] args) throws Exception {
|
||||
// creating instance of JFrame
|
||||
int boardWidth = 400;
|
||||
int boardHeight = 400;
|
||||
|
||||
JFrame game = new JFrame();
|
||||
game.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
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
|
||||
// images :
|
||||
// https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQN6qOyhiUDLlTlwl19PaMTeiY5rSOqkUqu-g&s
|
||||
|
||||
Reference in New Issue
Block a user