Note from faye: On Wednesday, we created a GUI interface to our board: TTTWindow. - TTTWindow is just an extension of JFrame. - We first configured our container layout to be a grid (BoardSize x Boardsize). - We then created a 2-d array of JLabels (BoardSize x Boardsize), and added them to our container. - note: I further enhanced this (this evening) to add etched borders to each label, and to horizontally centre the text on each label. As well, I eliminated the pack command which caused the gameboard to be unusually small, and changed the JFrame size and location to make it more viewable. Today (Friday), we considered how to put the pieces together. - We have a complete board which would allow us to play the game using method calls. - We have a GUI window which displays our board in an eye-pleasing way. - How would we play the game with this? Well, we considered the steps we would have to take. This is a rough description of the algorithm we came up with. 1) Create a new TicTacToe board game (t). Initialize it. 2) Create a window (w) using our new board game. Initialize it. 3) Player selects move 4) (t) makes move. 5) (w) is updated to reflect new move. 6) (t) checks for winner or draw 7) If no winner or draw (check using t methods) then switch player and loop back to step 3) else dislay winner or draw message, and end the game. - We decided to use JOptionPane.showInputDialog to get our user moves, assuming that the 1st and 3rd characters input represented the numeric row/column entered. - We learned how to convert a number written as a character to the integer it represents. (you should try this in interactive mode! Why does this work?). - Since class, I added code to verify whether the move is valid or not, and if not, to loop. There are good hints, examples and instructions in the swing tutorial: http://java.sun.com/docs/books/tutorial/uiswing/ Final comments from faye: We are coming down to the last few weeks. Every course is demanding work and it can be hard to balance and still stay sane. However, I recommend that you do not leave Assigment 3 to the last minute. Our deadlines are fairly fixed and most people have used up their grace day. Get started so that if you are confused, you can come for help or clarification (or to TA). When starting this assignment, think about the principles we applied here. First we designed a board that would let us play using only method calls if we wanted. Then we built our GUI. Before putting it all together We first considered the steps that would be required to play the game, then implemented them in our game class. I recommend that you get things working properly before you worry about how "fancy" your gui is. Fine tuning can take a lot of time, and is best left to the end. Good Luck!