package chess;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Board extends JPanel implements ActionListener, MouseListener {
	private static final long serialVersionUID = 2L;
	
	private int[][] boardState = new int[8][8];
	private JButton resignButton;
	private JButton newGameButton;
	private JLabel chessMessage;
	
	
	/**
	 * Constructor that creates the chess panel 
	 * and its associated components. Adds these 
	 * components to the panel.
	 */
	public Board() {
		setLayout(null);
		setPreferredSize(new Dimension(700, 600));
		setBounds(0, 50, 700, 600);
		setBackground(Color.GRAY);
		boardState = setupData();
		resignButton = new JButton("Resign");
		resignButton.setBounds(590, 50, 100, 30);
		
		newGameButton = new JButton("New game");
		newGameButton.setBounds(590, 10, 100, 30);
		
		chessMessage = new JLabel("White: Make your move.");
		chessMessage.setBounds(100, 470, 400, 50);
		chessMessage.setFont(new Font(Font.SERIF, Font.PLAIN, 25));
		
		add(resignButton);
		add(newGameButton);
		add(chessMessage);
	} //end constructor
	
	public int[][] setupData() {
		for (int i = 0; i < boardState.length; i++) {
			for (int k = 0; k < boardState[0].length; k++) {
				
			}
		}
		return boardState;	
	}
	
	/**
	 * Paints the chess board.
	 */
	public void paintComponent(Graphics paint) {
		paint.setColor(Color.BLACK);
		paint.drawRect(20, 20, 450, 450);
		paint.drawRect(21, 21, 448, 448);		//Draws 2px wide border
		
	}
	
	public void actionPerformed(ActionEvent evt) {}
	public void mouseReleased(MouseEvent mEvt) {}
	public void mousePressed(MouseEvent mEvt) {}
	public void mouseClicked(MouseEvent mEvt) {}
	public void mouseEntered(MouseEvent mEvt) {}
	public void mouseExited(MouseEvent mEvt) {}
	
	
} //class

@@ -619,38 +619,8 @@
 );%0D%0A
-%09%09setBackground(Color.GRAY);%0D%0A
 %09%09bo
@@ -640,24 +640,28 @@
 tupData();%0D%0A
+%09%09%0D%0A
 %09%09resignButt
@@ -730,24 +730,65 @@
  100, 30);%0D%0A
+%09%09resignButton.addActionListener(this);%0D%0A
 %09%09%0D%0A%09%09newGam
@@ -865,24 +865,66 @@
  100, 30);%0D%0A
+%09%09newGameButton.addActionListener(this);%0D%0A
 %09%09%0D%0A%09%09chessM
@@ -1001,24 +1001,114 @@
 ds(1
-0
+2
 0, 47
-0
+5
 , 400, 
-50
+45);%0D%0A%09%09chessMessage.setOpaque(true);%0D%0A%09%09chessMessage.setBackground(new Color(242, 232, 172)
 );%0D%0A
@@ -1672,24 +1672,24 @@
 %0A%09%09%0D%0A%09%7D%0D%0A%09%0D%0A
-
 %09public void
@@ -1719,24 +1719,289 @@
 Event evt) %7B
+%0D%0A%09%09Object src = evt.getSource();%0D%0A%09%09if (src == resignButton) %7B%0D%0A%09%09%09chessMessage.setText(%22White/black has resigned. White/black wins.%22);%0D%0A%09%09%7D%0D%0A%09%09else if (src == newGameButton) %7B%0D%0A%09%09%09chessMessage.setText(%22White: Make your move.%22);%0D%0A%09%09%09chessMessage.repaint();%0D%0A%09%09%7D%0D%0A%09
 %7D%0D%0A%09public v

Fix JLabel problems