OK, I see but how do I get it to be random whether it will draw a line or a circle?
Type: Posts; User: xterradaniel
OK, I see but how do I get it to be random whether it will draw a line or a circle?
I just don't get it, I guess.
I don't see how to use a class to save the coordinates and then use that in paintComponent.
OK, I get what you are saying to do. However, since I don't actually need to draw the lines that would separate the grid into 3 x 3, should I still just compute the centers of where the 9 boxes would...
No, I am sorry if I was misleading. I know how to draw lines for a 3 x 3 grid, I already had to write a program like that for my first assignment in GUI. The program description does not even call...
well if I draw a line by its coordinates as: g.drawLine(x, y, x, y,);
then how can I store it as an object or something so that I can randomly paint it in any of the positions in a 3 x 3 grid?
or...
I can draw an X with the: protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawLine(int x,...
OK, I can't get any further. I have written and erased and re-written my code over and over and I can't seem to figure it out, or even get to the point I was at earlier.
I think I am getting hung...
Not exactly, what I am trying to figure out is: I am using a 3 x 3 grid and each time there may be something like this: x0x or 00x
xx0 0x0
0x x0
I could get the...
I need to create a custom panel that displays X,0, or nothing, randomly.
It is supposed to be something like a tic tac toe board. The only thing is, when you open it it must randomly place the x's,...