Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    15
    Views
    1,363

    Re: Please help a new programmer in Java applet

    I'd start with a single piece. Define it, locate it in a square and draw it in that square.
    Then work on how to move it from one square to another square.

    When that is working, move on to having...
  2. Replies
    15
    Views
    1,363

    Re: Please help a new programmer in Java applet

    Where in the code are you trying to display any pieces?


    When I execute the program I get a window that looks like the one in the image you posted.
  3. Replies
    15
    Views
    1,363

    Re: Please help a new programmer in Java applet

    Sorry, I'm not sure now what you are having problems with. What is wrong in the image you posted?
    What does the code do now? What is wrong with what it is doing?
    Add some printlns to show the...
  4. Replies
    15
    Views
    1,363

    Re: Please help a new programmer in Java applet

    Are you asking how to find the square's location in the grid where there was a mouse click?

    You need to do some arithmetic. Take a piece of paper, draw a grid, mark its x,y location on the paper....
  5. Replies
    15
    Views
    1,363

    Re: Please help a new programmer in Java applet

    Can you explain what that means? What is the name of the array? How can it be on a corner of a grid?
  6. Replies
    15
    Views
    1,363

    Re: Please help a new programmer in Java applet

    It depends what a "unit" is. An image or text or what?
    The Graphics class has several methods that draw things at an x,y location. If the code changes the x,y locations over time, the thing will...
  7. Replies
    15
    Views
    1,363

    Re: Please help a new programmer in Java applet

    One way to determine where a user has clicked is to use a mouse listener. The event object passed to the listener has the x,y location of the mouse event. Given that x,y you can find the square...
Results 1 to 7 of 7