I am devoloping a Tic Tac Toe game which plays Computer Vs User but i dont know how i would design a radio button which makes a choice who will play first
Originally posted by Yugendra Reddy Guvvala: ...choice who will play first
If I understand your problem correctly, you want something which will decide who gets to play first, just like flipping a coin or something and you want to represent it using a radio button.
The Random class has many useful methods which you can use. First which comes to mind is the nextBoolean().
Actually I have developed the TIC TAC TOE application in which user plays with computer my question is I want to have a window displayed first asking whether the user have to play first or the computer. Which should have 2 radio buttons and one yes button and one cancel button and the window should return either user or computer to the program then the game should start accordingly I know how to do it in HTML but not in JAVA I tried some radio button examples but could not find current answer relevant to my question
If the user can decide who is first, I think you can use the raido button swing and it's easy , you need read the tutorial.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35438
9
posted
0
What specifically are you struggling with? If you have code that shows two radio buttons, and code that checks which of the buttons is selected, then what you're trying to do should be easy, shouldn't it? What do you have so far?
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.