Week 3 Programming Assignment
Create a Java program for the following problem. Do not use any of the GUI editing capabilities of Eclipse for this assignment. Do all the GUI layout work based on what you have learned in class this week. Do NOT use setBounds since we are NOT going to be studying this.
Write a Java application to display the following GUI. At this point you are only implementing the display. We are not ready to make the game actually work!
This program has the following requirements:
1. The background and foreground color of the Tic Tac Toe board buttons must alternate in a pattern as shown above. You can choose any pair of colors for your foreground and background colors. Use the setForeground and setBackground methods of the button objects to set the color.
2. The Tic Tac Toe board buttons should have at least 5 pixels of space between them.
3. The text in the Tic Tac Toe board buttons should be SanSerif size 24 and be bold. Use the setFont method of the buttons to set the font.
4. Your application should be implemented in a single class. The main method of the class does nothing more than create an object of the class. The constructor of the class creates and displays the GUI. The constructor may call other methods of the class if needed.
5. Do not use inheritance for this program. Use a JFrame member variable as the main window object for this program. Make sure to set the title of the window.
6. The text fields should accommodate 3 characters.
7. The labels should be next to the corresponding textfields. Hint: Put each label and its adjacent text field into a panel, then put both panels into another panel!
8. The label at the top and the button at the bottom should NOT be placed into a panel. Use your name in the label at the top.
Take screen shots of the output of program. Paste the screen shot and your source code for your program into a Word document.
Please place things in the following order:
Screen shot of problem. Code for problem.