@Override protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; g2.setStroke(LineSize); g2.setColor(ColorFactory.getLineColor()); for (int i = 0; i < connections.length; ++i) { g2.draw(connections[i]); } if (getLocation().x != location.x || getLocation().y != location.y) { // if (getLocation().x != 0 && getLocation().y != 0) { setLocation(location); } } }