Here you can find the source of createColourIcon(int colour)
public static Icon createColourIcon(int colour)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; import javax.swing.Icon; import javax.swing.ImageIcon; public class Main { public static Icon createColourIcon(int colour) { BufferedImage image = new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB); for (int x = 0; x < 16; x++) { for (int y = 0; y < 16; y++) { image.setRGB(x, y, colour); }/*from w ww . j a v a 2 s. co m*/ } return new ImageIcon(image); } }