ok so have been assigned to make a 2 player tic tac toe game for my final project this year in school. However since this is a fisrt year java course we are using like "fake java" just to get the hang of it. Except now i have to work on the program from home cause i have been sick and the java compiler at my house doesnt understand the "fake java". so basically my question is how do u display a 3 by 3 grid of buttons? because at the moment i have a line of nine buttons that actually allow you to play the game correctly if you take the 4,5, and 6 buttons and make them the second row and the 7,8, and 9 and make it the thrid row, but i cant figure out how to do that
Hockeyfreak889 0
Light Poster
Recommended Answers
Jump to PostWhat do you mean by "fake Java"? Do you mean Processing? if that is the case than you can simply download it as it is free.
If it is not processing, and you can't go back to what your used to, than please post your code.
…
Jump to PostUse a GridLayout. If you have 3x3 grid, that's 3 rows and 3 columns. So Gridlayout whatever = new GridLayout (3,3). Problem hopefully solved. And..
Good luck.
All 5 Replies
sciwizeh 62
Posting Pro in Training
Hockeyfreak889 0
Light Poster
BestJewSinceJC 700
Posting Maven
Hockeyfreak889 0
Light Poster
BestJewSinceJC 700
Posting Maven
sciwizeh
commented:
That's what I suggested, he wouldn't have had to use gridbag if he had payed attention in the first place +2
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.