Transparent icon with no content : Icon « 2D Graphics GUI « Java






Transparent icon with no content

    

/*
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public
    License as published by the Free Software Foundation; either
    version 2 of the license, or (at your option) any later version.
*/


import javax.swing.*;
import java.awt.*;

/**
    Transparent icon with no content.

    @author <a href="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
    @version $Revision: 1.1 $ $Date: 2003/08/18 07:46:43 $
*/
public class EmptyIcon implements Icon {

    private int width;
    private int height;

    /**
     * Constructor.
     * @param width the width of the icon.
     * @param height the height of the icon.
     */
    public EmptyIcon(int width, int height) {
        this.width = width;
        this.height = height;
    }

    public void paintIcon(Component c, Graphics g, int x, int y) {
    }

    public int getIconWidth() {
        return width;
    }

    public int getIconHeight() {
        return height;
    }
}

   
    
    
    
  








Related examples in the same category

1.Create a dynamic icon
2.A simple application to test the functionality of the OvalIcon classA simple application to test the functionality of the OvalIcon class
3.Icon DisplayerIcon Displayer
4.Implement the Icon interfaceImplement the Icon interface
5.Calendar Page icons with Weekday, Day and MonthCalendar Page icons with Weekday, Day and Month
6.MemImage is an in-memory icon showing a Color gradientMemImage is an in-memory icon showing a Color gradient
7.Example of an icon that changes formExample of an icon that changes form
8.Custom Icon DemoCustom Icon Demo
9.Create Image Icon from PNG file
10.Reading an Image or Icon from a File
11.Draw an Icon object
12.Plain Color Icon
13.Color Icon
14.Arrow Icon
15.Icon Line
16.Return a filled oval as an Icon
17.Layered Icon
18.An icon for painting a square swatch of a specified Color.
19.An empty icon with arbitrary width and height.
20.Creates a transparent icon.
21.Icon Codec