public void paintComponent(Graphics g) { clearScreen(g); drawGrid(g); drawElements(g); if (drawBondLine == true) { Bond.drawDrag(g, Color.MAGENTA, elist.getSelected(), currentX, currentY); } if (drawArrowLine == true) { Arrow.drawDrag(g, Color.BLUE, elist.getSelected(), currentX, currentY); } drawConnections(g); }