please include function drawThoughtLine. static void drawThoughtArrow(BufferedImage bg, BufferedImage img1, int x1, int y1, BufferedImage img2, int x2, int y2) { Graphics2D g = imageGraphics(bg); g.setColor(Color.white); g.setStroke(new BasicStroke(drawThoughtLine_width)); g.drawLine(x1, y1, x2, y2); drawArrowHead(g, x1, y1, x2, y2); g.dispose(); }