Tuesday, 8 April 2014

JComboBox

The drop down menu for selecting the number the player wants to ask the computer works (yay, but why is it even called a JComboBox??). Before, when I put it in the gam();, it didn't work because in the reset method, I had made the linked list for  playerHand empty and in the play method it was still 0. Which meant the for loop for adding items onto the drop down menu wouldn't work.

Then I tried to put the line of code for the drop down menu with the reset method and it worked. But then I thought that maybe it wouldn't work for the rest of the game, when the players' hands started to grow or shrink, so I removed it from the reset(); but it turns out that I'm just going crazy and that it would work for the rest of the game since later on, I'll just have to use some other method that's in JComboBox and remove an item or whatnot.

So, drop down menu is dealt with. Now I should actually show somewhere the computer hand's cards so I'll know if the game's actually working. But obviously while playing the game, the computer's hand wouldn't be seen. And also to actually start...programming this game.

No comments:

Post a Comment