rajah_mohammed
asked on
Color Question
Hi;
I'm trying to create a chess game and I'm trying to implement the chessboard here's what I got :
for (int i=1; i<=8; i++) {
for(int j=1; j<=8; j++ ) {
board = new JPanel();
board.setBorder(BorderFact ory.create EtchedBord er());
panel1.add(board);
board.setBackground(Color. white);
}
}
I'm trying to set the colors of each block to white and green just any ordinary chess board. How will I be able to do it in my codes ? thanks.
I'm trying to create a chess game and I'm trying to implement the chessboard here's what I got :
for (int i=1; i<=8; i++) {
for(int j=1; j<=8; j++ ) {
board = new JPanel();
board.setBorder(BorderFact
panel1.add(board);
board.setBackground(Color.
}
}
I'm trying to set the colors of each block to white and green just any ordinary chess board. How will I be able to do it in my codes ? thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad I could help.
Regards
Dave
Regards
Dave
ASKER
if((int)(i+j)/2==(int)(i+j
}