Here you can find the source of drawVerticalLineAt(int x, int dottedLine, Color color, BufferedImage displayMap)
public static void drawVerticalLineAt(int x, int dottedLine, Color color, BufferedImage displayMap)
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.awt.image.BufferedImage; public class Main { public static void drawVerticalLineAt(int x, int dottedLine, Color color, BufferedImage displayMap) { for (int y = 0; y < displayMap.getHeight(); y += dottedLine) { drawPixel(x, y, color, displayMap); }/*from w w w . j av a 2 s .com*/ } public static void drawPixel(int x, int y, Color color, BufferedImage displayMap) { if (x < 0 || y < 0 || x >= displayMap.getWidth() || y >= displayMap.getHeight()) { return; } displayMap.setRGB(x, y, color.getRGB()); } }