<HTML>
<HEAD>

<!-- Change the Title please -->
<TITLE>AWT SHORT COURSE: Component</TITLE>
</HEAD>

<!-- BODY-TEMPLATE -->

<!-- NAVBAR-PULLQUOTE-TEMPLATE -->
<TR VALIGN=TOP>
<td width=178>

<BR clear=LEFT>
<TABLE ALIGN=LEFT>
<TR VALIGN=TOP>
<td width=60>
<a href="../TOC.html"><img border=0 src="/developer/images/magelang/contents.gif" alt="contents" WIDTH=147 HEIGHT=23></a>
</td>
</tr>
<tr>
<td>
<a href="Widgets.html"><img border=0 src="/developer/images/magelang/previous.gif" hspace=10 alt="Previous" width=64 height=20></a>
</td>
<td>
<a href="Button.html"><img border=0 src="/developer/images/magelang/next.gif" alt="Next" width=43 height=20></a>
</td>
</tr>
</table>

</TR>
</TABLE>

<!-- PAGETOP-TEMPLATE -->
<TR>
<TD WIDTH=452 ALIGN=RIGHT>
<img src=images/ShortCourse.gif>
</TD>
</TR>
<TR>
<TD WIDTH=452 COLSPAN=2 ALIGN=right>
<!--breadcrumb trail; change to reflect the current URL-->
<!-- Please change to reflect where _exactly_ you are in the site
<!-- Add more subcategories as needed  -->

<!-- Please Change these.  The Links are SubCat#, and titled SubCategory# -->
</TD>
</TR>

<!--- Please put everything you want here to the right of the navbar.
	<TR>
	<TD>
	This is the MAIN TABLE.  Put data HERE unless you need a table that
 	REQUIRES the full screen width, i.e. an event schedule table.
	Add a new table row for the data.

	If the text needs to be in two columns, use this <TR> structure:
	Make the width=452
	<TR>
	<TD WIDTH=226>
	</TD>
	<TD WIDTH=226>
	</TD>
	</TR>

	</TD>
	</TR>
--->

<TR>
<TD width=452>
<p>
<a name="Component">
<font size=+1><b>Component</b></font><P>
</a>

A <a href="http://java.sun.com:80/products/JDK/CurrentRelease/api/java.awt.Component.html">Component</a> is a generic widget that is never instantiated. However, all graphics widgets derive from Component--an abstract class that provides some commonly used methods.
 <p>
Methods:
<p>
These do not include the event-convenience methods and functionality not discussed in this short course):
<ul>
<li><tt>public Rectangle bounds()</tt><br>
Returns the size of the Component.
<li><tt>public void disable()</tt><br>
Makes the Component insensitive to user input; normally, the Component's appearance "dehighlights" as well.
<li><tt>public void enable()</tt><br>
Makes the Component sensitive to user input.
<li><tt>public Font getFont()</tt><br>
What Font is associated with this Component?  You need this when you want to change its Font and then restore it.
<li><tt>public Graphics getGraphics()</tt><br>
Returns the graphics context of this component.  If this Component is not currently being displayed, null is returned.
<li><tt>public void paint(Graphics  g)</tt><br>
Tells the window toolkit to paint the Component.  Most subclasses override this method.
<li><tt>public void repaint()</tt><br>
Repaints the Component; the Component is erased then painted.
<li><tt>public void setFont(Font f)</tt><br>
Sets the font for a Component.
<li><tt>setForeground(Color  c)</tt><br>
Sets the color of the Component's foreground.
</ul>
</TD>
</TR>
</TABLE>

<!--
        This table is for everything that goes under the 
        navbar, it is a full screen table. Use this table 
        ONLY for full screen width tables like an event 
        hourly schedule.
-->

<br clear=left>
<TABLE ALIGN=left>

<tr>
<td WIDTH=600 align=right>

<!--Last Modified and copyright message

    Please modify the date whenever significant changes are made to 
    a page; leave the copyright alone
-->

</td>
</tr>
</TABLE>

</BODY>
</HTML>
