Hiya all,

This is probably a really simple question, but I've looked in books, posted questions etc and so far none the wiser. Basically what I'm trying to do, is to write a class which creates a JFrame with a JPanel in it. Then I want a set of methods which the main code can call, which places plot points at the designated co-ordinates.

As an example, I might want to do this (in the main code);

PlotFrame firstPanel = new PlotFrame(200, 300, "First window");
PlotFrame secondPanel = new PlotFrame(200, 300, "First window");

..... some code or other which creates, manipulates a large set of data ....

firstPanel.plotPoint(x, y, color);
firstPanel.plotPoint(x, y, other_color);
secondPanel.plotPoint(x, y, yet_other_color);

etc

I can create the window no probs (with different sizes, colors etc etc), but once I've plotted the first point, anynew point will "delete" the old plots once the panel is redrawn?!? I have tried with only redrawing the actual plotpoint, but if there are lines crossing over etc, this wont work anyway.

Please, any hints/tips or pointers are very much appreciated. This is driving me mad

Cheers and best regards
Thomas