📄 imageicon.html
字号:
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#getImageLoadStatus()">getImageLoadStatus</A></B>()</CODE><BR> Returns the status of the image loading operation.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/awt/image/ImageObserver.html">ImageObserver</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#getImageObserver()">getImageObserver</A></B>()</CODE><BR> Returns the image observer for the image.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#loadImage(java.awt.Image)">loadImage</A></B>(<A HREF="../../java/awt/Image.html">Image</A> image)</CODE><BR> Loads the image, returning only when the image is loaded.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#paintIcon(java.awt.Component, java.awt.Graphics, int, int)">paintIcon</A></B>(<A HREF="../../java/awt/Component.html">Component</A> c, <A HREF="../../java/awt/Graphics.html">Graphics</A> g, int x, int y)</CODE><BR> Paints the icon.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#setDescription(java.lang.String)">setDescription</A></B>(<A HREF="../../java/lang/String.html">String</A> description)</CODE><BR> Sets the description of the image.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#setImage(java.awt.Image)">setImage</A></B>(<A HREF="../../java/awt/Image.html">Image</A> image)</CODE><BR> Sets the image displayed by this icon.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#setImageObserver(java.awt.image.ImageObserver)">setImageObserver</A></B>(<A HREF="../../java/awt/image/ImageObserver.html">ImageObserver</A> observer)</CODE><BR> Sets the image observer for the image.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/ImageIcon.html#toString()">toString</A></B>()</CODE><BR> Returns a string representation of this image.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="component"><!-- --></A><H3>component</H3><PRE>protected static final <A HREF="../../java/awt/Component.html">Component</A> <B>component</B></PRE><DL></DL><HR><A NAME="tracker"><!-- --></A><H3>tracker</H3><PRE>protected static final <A HREF="../../java/awt/MediaTracker.html">MediaTracker</A> <B>tracker</B></PRE><DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="ImageIcon(java.lang.String, java.lang.String)"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(<A HREF="../../java/lang/String.html">String</A> filename, <A HREF="../../java/lang/String.html">String</A> description)</PRE><DL><DD>Creates an ImageIcon from the specified file. The image will be preloaded by using MediaTracker to monitor the loading state of the image.<DD><DL><DT><B>Parameters:</B><DD><CODE>filename</CODE> - the name of the file containing the image<DD><CODE>description</CODE> - a brief textual description of the image<DT><B>See Also: </B><DD><A HREF="../../javax/swing/ImageIcon.html#ImageIcon(java.lang.String)"><CODE>ImageIcon(String)</CODE></A></DL></DD></DL><HR><A NAME="ImageIcon(java.lang.String)"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(<A HREF="../../java/lang/String.html">String</A> filename)</PRE><DL><DD>Creates an ImageIcon from the specified file. The image will be preloaded by using MediaTracker to monitor the loading state of the image. The specified String can be a file name or a file path. When specifying a path, use the Internet-standard forward-slash ("/") as a separator. (The string is converted to an URL, so the forward-slash works on all systems.) For example, specify: <pre> new ImageIcon("images/myImage.gif") </pre> The description is initialized to the <code>filename</code> string.<DD><DL><DT><B>Parameters:</B><DD><CODE>filename</CODE> - a String specifying a filename or path<DT><B>See Also: </B><DD><A HREF="../../javax/swing/ImageIcon.html#getDescription()"><CODE>getDescription()</CODE></A></DL></DD></DL><HR><A NAME="ImageIcon(java.net.URL, java.lang.String)"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(<A HREF="../../java/net/URL.html">URL</A> location, <A HREF="../../java/lang/String.html">String</A> description)</PRE><DL><DD>Creates an ImageIcon from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded state of the image.<DD><DL><DT><B>Parameters:</B><DD><CODE>location</CODE> - the URL for the image<DD><CODE>description</CODE> - a brief textual description of the image<DT><B>See Also: </B><DD><A HREF="../../javax/swing/ImageIcon.html#ImageIcon(java.lang.String)"><CODE>ImageIcon(String)</CODE></A></DL></DD></DL><HR><A NAME="ImageIcon(java.net.URL)"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(<A HREF="../../java/net/URL.html">URL</A> location)</PRE><DL><DD>Creates an ImageIcon from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded state of the image. The icon's description is initialized to be a string representation of the URL.<DD><DL><DT><B>Parameters:</B><DD><CODE>location</CODE> - the URL for the image<DT><B>See Also: </B><DD><A HREF="../../javax/swing/ImageIcon.html#getDescription()"><CODE>getDescription()</CODE></A></DL></DD></DL><HR><A NAME="ImageIcon(java.awt.Image, java.lang.String)"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(<A HREF="../../java/awt/Image.html">Image</A> image, <A HREF="../../java/lang/String.html">String</A> description)</PRE><DL><DD>Creates an ImageIcon from the image.<DD><DL><DT><B>Parameters:</B><DD><CODE>image</CODE> - the image<DD><CODE>description</CODE> - a brief textual description of the image</DL></DD></DL><HR><A NAME="ImageIcon(java.awt.Image)"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(<A HREF="../../java/awt/Image.html">Image</A> image)</PRE><DL><DD>Creates an ImageIcon from an image object. If the image has a "comment" property that is a string, then the string is used as the description of this icon.<DD><DL><DT><B>Parameters:</B><DD><CODE>image</CODE> - the image<DT><B>See Also: </B><DD><A HREF="../../javax/swing/ImageIcon.html#getDescription()"><CODE>getDescription()</CODE></A>, <A HREF="../../java/awt/Image.html#getProperty(java.lang.String, java.awt.image.ImageObserver)"><CODE>Image.getProperty(java.lang.String, java.awt.image.ImageObserver)</CODE></A></DL></DD></DL><HR><A NAME="ImageIcon(byte[], java.lang.String)"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(byte[] imageData, <A HREF="../../java/lang/String.html">String</A> description)</PRE><DL><DD>Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF or JPEG. Normally this array is created by reading an image using Class.getResourceAsStream(), but the byte array may also be statically stored in a class.<DD><DL><DT><B>Parameters:</B><DD><CODE>imageData</CODE> - an array of pixels in an image format supported by the AWT Toolkit, such as GIF or JPEG.<DD><CODE>description</CODE> - a brief textual description of the image<DT><B>See Also: </B><DD><A HREF="../../java/awt/Toolkit.html#createImage(java.lang.String)"><CODE>Toolkit.createImage(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="ImageIcon(byte[])"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>(byte[] imageData)</PRE><DL><DD>Creates an ImageIcon from an array of bytes which were read from an image file containing a supported image format, such as GIF or JPEG. Normally this array is created by reading an image using Class.getResourceAsStream(), but the byte array may also be statically stored in a class. If the resulting image has a "comment" property that is a string, then the string is used as the description of this icon.<DD><DL><DT><B>Parameters:</B><DD><CODE>imageData</CODE> - an array of pixels in an image format supported by the AWT Toolkit, such as GIF or JPEG<DT><B>See Also: </B><DD><A HREF="../../java/awt/Toolkit.html#createImage(java.lang.String)"><CODE>Toolkit.createImage(java.lang.String)</CODE></A>, <A HREF="../../javax/swing/ImageIcon.html#getDescription()"><CODE>getDescription()</CODE></A>, <A HREF="../../java/awt/Image.html#getProperty(java.lang.String, java.awt.image.ImageObserver)"><CODE>Image.getProperty(java.lang.String, java.awt.image.ImageObserver)</CODE></A></DL></DD></DL><HR><A NAME="ImageIcon()"><!-- --></A><H3>ImageIcon</H3><PRE>public <B>ImageIcon</B>()</PRE><DL><DD>Creates an uninitialized image icon.</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -