KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > Icon


1 /*
2  * @(#)Icon.java 1.16 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing;
8
9 import java.awt.Graphics JavaDoc;
10 import java.awt.Component JavaDoc;
11
12
13 /**
14  * A small fixed size picture, typically used to decorate components.
15  *
16  * @see ImageIcon
17  */

18
19 public interface Icon
20 {
21     /**
22      * Draw the icon at the specified location. Icon implementations
23      * may use the Component argument to get properties useful for
24      * painting, e.g. the foreground or background color.
25      */

26     void paintIcon(Component JavaDoc c, Graphics JavaDoc g, int x, int y);
27     
28     /**
29      * Returns the icon's width.
30      *
31      * @return an int specifying the fixed width of the icon.
32      */

33     int getIconWidth();
34
35     /**
36      * Returns the icon's height.
37      *
38      * @return an int specifying the fixed height of the icon.
39      */

40     int getIconHeight();
41 }
42
Popular Tags