KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > util > EmptyIcon


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

7
8 package org.gjt.jclasslib.util;
9
10 import javax.swing.*;
11 import java.awt.*;
12
13 /**
14     Transparent icon with no content.
15
16     @author <a HREF="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
17     @version $Revision: 1.1 $ $Date: 2003/08/18 07:46:43 $
18 */

19 public class EmptyIcon implements Icon {
20
21     private int width;
22     private int height;
23
24     /**
25      * Constructor.
26      * @param width the width of the icon.
27      * @param height the height of the icon.
28      */

29     public EmptyIcon(int width, int height) {
30         this.width = width;
31         this.height = height;
32     }
33
34     public void paintIcon(Component c, Graphics g, int x, int y) {
35     }
36
37     public int getIconWidth() {
38         return width;
39     }
40
41     public int getIconHeight() {
42         return height;
43     }
44 }
45
Popular Tags