Adds new Java files for Chess game logic, piece representation, and display initialization, along with imports for GUI and event handling. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: b3669ecc-6df5-4941-bb0c-6a0ed9bbd81e Replit-Helium-Checkpoint-Created: true
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 |