Search:

Type: Posts; User: Norm

Search: Search took 0.15 seconds.

  1. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    Look at the Random class. It has many methods to choose from.
    Get the System time and test if its odd or even.
  2. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    // A class to save the starting and ending x,y coords for a line


    class LineCoords {
    int firstX;
    int firstY;
    int endX;
    int endY;
    // draw the above line
    public void drawLine(Graphics...
  3. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    Use classes to hold the properties of the figures vs using arrays.

    If the center coords require too much programming, then save the x,y for the upper left corner vs the center.


    What is random...
  4. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    Ok, drawing the lines and repositioning them when the component changes size is solved.
    Now you want to draw an image in one of the nine squares created by the lines.
    Is that the problem?
    A...
  5. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    Which problem is this one? I thought we were working on how to draw the lines for the 3x3 grid.
    What goes in the squares of the grid was going to be a simple "X" or "O" drawn by drawString().
    ...
  6. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    Which problem are you working on? One at a time is better.


    You compute the x,y of the ends of the lines and save them for the paint method to use.
  7. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    If getting a image is a problem right now, leave it until later to solve.
    Use something simple to get the logic working for now. Something like: drawString(x,y, "X") for example.
  8. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    Ok, we'll want until you get a new design.
  9. Replies
    19
    Views
    5,370

    Re: Creating a custom panel:

    Are you asking how to choose which image to display?
    See the Random class. It has methods to return random values that you could use to choose which image to display.


    Again you can use the...
Results 1 to 9 of 9