> My name is not Andy.
>
[quoted text clipped - 3 lines]
>
> I'll.. think about it.
> > My name is not Andy.
> >
[quoted text clipped - 5 lines]
> Hi And<B>rew</B>,
> Sorry for having used a wrong name!
G'Day hiwa ;-)
> Currently, my not-so-happy solution is as follows:
> <code>
[quoted text clipped - 21 lines]
> g.drawLine(prevX, prevY, newX, newY);
> }
I have an admission to make. I never looked at
your initital code snippet. (till this instant)
I do not spend many moments of my life looking
at code snippets, on prinicipal, as well as for
practical reasons.
In this situation, there was even less point,
since I already knew how to achieve what
you wanted.
Now I realise that _you_ actually knew how to
achieve the effect from the start (as your initial
code 'snippet' seems to imply), but were just
unhappy with the solution.
The only real further help I can be here is to say
..get over it. Simply draw the grid after the BG
of the panel has been painted, but before
drawing _your_ own objects.
(shrugs) Hey, anybody else listening feel free to
jump in and prove me wrong, but that seems the
way to do it.
[ BTW - I have upgraded my own to draw a
simple grid as well. Source is linked from the page.
http://www.physci.org/test/AnimatePanel/ ]
--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
hiwa - 19 Dec 2003 10:05 GMT
> Now I realise that _you_ actually knew how to
> achieve the effect from the start (as your initial
> code 'snippet' seems to imply), but were just
> unhappy with the solution.
I feel plotting into an Image object is kinda rather tall talk and I
hate it. As I'd like to have simpler code which might be on a par with
the plotting on a java.awt.Panel, I had posted the initial post. I
want to do plotting on a Swing component more 'naturally'.
> [ BTW - I have upgraded my own to draw a
> simple grid as well. Source is linked from the page.
> http://www.physci.org/test/AnimatePanel/ ]
Your grid is a beautiful tour de force. But it is still an animation
done in a single for loop in a single invocation of the
paintComponent() method. Plotting can also be done by calling
Graphics#drawPolyine() in a single paint. But my requirement is
realtime update of the x/y coords.