Java Swing Icon createColourIcon(int colour)

Here you can find the source of createColourIcon(int colour)

Description

create Colour Icon

License

Open Source License

Declaration

public static Icon createColourIcon(int colour) 

Method Source Code

//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);
    }
}

Related

  1. clearMergedIconsCache()
  2. combineIcons(Icon underIcon, Icon overIcon)
  3. concatenateIcons(final Icon icon1, final Icon icon2)
  4. createBitmap(Icon icon)
  5. createChannelIcon(Icon ic)
  6. createGrayIcon(Icon icon)
  7. createGrayIcon(Icon icon)
  8. createIcon(java.awt.Component component)
  9. createIcon(String resource)