Search:

Type: Posts; User: xterradaniel

Search: Search took 0.24 seconds.

  1. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    OK, I see but how do I get it to be random whether it will draw a line or a circle?
  2. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    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.
  3. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    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...
  4. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    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...
  5. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    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...
  6. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    I can draw an X with the: protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    g.drawLine(int x,...
  7. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    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...
  8. Replies
    19
    Views
    2,498

    Re: Creating a custom panel:

    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...
  9. Replies
    19
    Views
    2,498

    Creating a custom panel:

    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,...
Results 1 to 9 of 9