Create a tic tac toe GUI object. a) There should be a text box (look up JTextFie
ID: 3540338 • Letter: C
Question
- Create a tic tac toe GUI object.
a) There should be a text box (look up JTextField). When the game starts, the text field should say "would you like to play tic tac toe?" There should be two buttons below the text field. One says "yes" and the other says "no". If button "no" is pressed the GUI should close and the program should quit. If button "yes" is pressed, both of these 2 buttons should disappear (look up setVisibile), the Text Field should say "X, pick a square" (look up method setText). There should now be 9 buttons in a 3x3 grid (use GridLayoutManager for these 9 buttons but the other 2 buttons and text field should be placed with a different layout manger - I recommend using BorderLayoutManager for this, but you dont have to). you will also probably have to resize the 9 buttons so that they will each be a square. When one of these 9 buttons is pressed:
i) the text of the button should represent which player pressed the button.
ii) the text field should change to indicate whose turn it is now
and iii) that button pressed should remain visible, but become disabled (look up method setEnabled)
When all 9 squares are filled (dont worry about deciding a winner), the text field should display a message asking the user if they want to play again, and those original two buttons (yes and no) should reappear
a) There should be a text box (look up JTextField). When the game starts, the text field should say "would you like to play tic tac toe?" There should be two buttons below the text field. One says "yes" and the other says "no". If button "no" is pressed the GUI should close and the program should quit. If button "yes" is pressed, both of these 2 buttons should disappear (look up setVisibile), the Text Field should say "X, pick a square" (look up method setText). There should now be 9 buttons in a 3x3 grid (use GridLayoutManager for these 9 buttons but the other 2 buttons and text field should be placed with a different layout manger - I recommend using BorderLayoutManager for this, but you dont have to). you will also probably have to resize the 9 buttons so that they will each be a square. When one of these 9 buttons is pressed:
i) the text of the button should represent which player pressed the button.
ii) the text field should change to indicate whose turn it is now
and iii) that button pressed should remain visible, but become disabled (look up method setEnabled)
When all 9 squares are filled (dont worry about deciding a winner), the text field should display a message asking the user if they want to play again, and those original two buttons (yes and no) should reappear
Explanation / Answer
http://www.studentlance.com/buy-now?sid=20255
Here is the link for your code
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.