Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java - Checkerboard

dickersonka
dickersonka 


Write a graphical application that displays a checkerboard with 64 squares, alternating white and black. Attachments
Tags Clarifications

Answers

Java - Checkerboard - Solution

dickersonka
dickersonka 



Attached is the solution to the Java - Checkerboard including source, comments, and screenshot Attachments
CheckerBoard.zip (10 K) Download
Preview
20, 20); //set color if (i % 2 == j % 2){ g2.setColor(Color.WHITE); }else { g2.setColor(Color.BLACK); } //fill rectangle g2.fillRect(j * 20 + 10, i * 20 + 10,

Preview

Preview
final int FRAME_WIDTH = 300; final int FRAME_HEIGHT = 400; frame.setSize(FRAME_WIDTH, FRAME_HEIGHT); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Screenshots
Screenshot
Purchase Answer