error Icon - Java 2D Graphics

Java examples for 2D Graphics:Icon

Description

error Icon

Demo Code

// Copyright (C)1996,1998 by Jef Poskanzer <jef@mail.acme.com>.  All rights reserved.
//package com.java2s;
import java.awt.*;
import java.awt.image.*;

public class Main {
    private final static int errorWidth = 17;
    private final static int errorHeight = 17;
    private static int[] errorPixels = { // color model is AARRGGBB
    0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000, 0xff000000,
            0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
            0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0xff000000, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0xff000000, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0x00ffffff, 0xff000000, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000, 0x00ffffff,
            0xff000000, 0xff000000, 0xff000000, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0xff000000, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0xff000000, 0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0xff000000,
            0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0x00ffffff, 0xff000000, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0xff000000,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0xff000000, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0xff000000, 0x00ffffff, 0xff000000, 0xff000000, 0xff000000,
            0xff000000, 0xff000000, 0xff000000, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000,
            0x00ffffff, 0xff000000, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff,
            0xff000000, 0x00ffffff, 0xff000000, 0x00ffffff, 0x00ffffff,
            0x00ffffff, 0x00ffffff, 0x00ffffff };
    private static ImageProducer errorSource = null;

    public static Image errorIcon(Component comp) {
        if (errorSource == null)
            errorSource = new MemoryImageSource(errorWidth, errorHeight,
                    errorPixels, 0, errorWidth);
        return comp.createImage(errorSource);
    }//  w ww.  j ava 2s .  c o  m
}

Related Tutorials