Here you can find the source of drawPixel(int x, int y, Color color, BufferedImage displayMap)
public static void drawPixel(int x, int y, 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 drawPixel(int x, int y, Color color, BufferedImage displayMap) { if (x < 0 || y < 0 || x >= displayMap.getWidth() || y >= displayMap.getHeight()) { return; }// w w w . j ava 2 s . c om displayMap.setRGB(x, y, color.getRGB()); } }