super.paintComponent(graph1);
reset_trace = false;
}
for (int i = 0; i < s.particles.size(); i++) {
Particle par = (Particle) s.particles.get(i);
if (par.getCharge() > 0) {
graph.setColor(Color.red);
} else {
graph.setColor(Color.blue);
}
double radius = par.getRadius();
int width = (int) (2*sx*radius);
int height = (int) (2*sy*radius);
if(width > 2 && height > 2 && !paint_trace) {
graph.fillOval((int) (par.getX()*sx) - width/2, (int) (par.getY()*sy) - height/2, width, height);
}
else {
graph.drawRect((int) (par.getX()*sx), (int) (par.getY()*sy), 0, 0);
}
}
if(drawCurrentGrid)
{