tags:

views:

30

answers:

0

Hi Guys,

I am doing a little animation and i need help. This is my task. I have to draw a grid of 3 X 3 (2D array). In this grid, the last row (3 cells) will contain three horizontal track rails. The first two cells in the last column will also contain two vertical track rails. A car object(a rounded circle) will be moved on this track rails.

I have drawn the 3 X 3 (2D array) grid using the Gridlayout. At the moment what i have done is each cell contains an image on JLabel( i don't know if it is the right way). My question is how can i draw in a specific cell. My plan is anytime the real car robot send its position i will draw it in the correct cell and then i will delete the old one.

At the moment i don't know how to draw the car object in a specific cell. The Grid will serve as a form of a background on which i can draw the car object. But i don't know how to draw in a specific cell in the grid.

Am doing in in Java. Please if there is a better way of doing it , then tell me.

Please help me out.

All suggestions are welcomed.

Thanks