<HTML>
<HEAD>

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

<!-- Start Body Insert-->
<BODY BGCOLOR="#ffffff">
<!-- End Body Insert-->


<!-- Start NavBar Insert -->
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=134 ALIGN=LEFT>
  <TR>
    <TD WIDTH=600 VALIGN=TOP ALIGN=RIGHT>      
      <A HREF="/developer/techSupport/"><IMG WIDTH=134 HEIGHT=84 SRC="/images/menuts.gif" ALT="Technical Support" BORDER=0></A><BR>
      <A HREF="/developer/discussForum/"><IMG WIDTH=134 HEIGHT=20 SRC="/images/menudf.gif" ALT="Discussion Forum" BORDER=0></A><BR>
      <A HREF="/developer/onlineTraining/"><IMG WIDTH=134 HEIGHT=26 SRC="/images/menuot.gif" ALT="Online Training" BORDER=0></A><BR>
      <A HREF="/developer/readAboutJava/"><IMG WIDTH=134 HEIGHT=27 SRC="/images/menuraj.gif" ALT="Read About Java" BORDER=0></A><BR>
      <A HREF="/developer/javaInDepth/"><IMG WIDTH=134 HEIGHT=26 SRC="/images/menujid.gif" ALT="Java In-Depth" BORDER=0></A><BR>
      <A HREF="/developer/productDiscount/"><IMG WIDTH=134 HEIGHT=24 SRC="/images/menupd.gif" ALT="Product Discounts" BORDER=0></A><BR>
      <A HREF="/developer/memberInfo/"><IMG WIDTH=134 HEIGHT=25 SRC="/images/menumi.gif" ALT="Membership Information" BORDER=0></A>
      <P>
      <CENTER>
      <A HREF="http://java.sun.com/"><IMG WIDTH=31 HEIGHT=54 SRC="/images/cuplogo.gif" ALT="Java Cup Logo" BORDER=0></A>
	</CENTER>      
	</P>

      <p>
	<CENTER><font size=-1>
      <a href="/developer/jdchome.html">JDC Home Page</a>
      </font>
	</CENTER>
      </P>
    </TD>
  </TR>
<!-- End NavBar Insert -->

<TR VALIGN=TOP>
<td width=124>

<BR clear=LEFT>
<TABLE ALIGN=LEFT>
<TR VALIGN=TOP>
<td width=60>
<a href="../TOC.html"><img border=0 src="/images/magelang/top.66x19.gif" ALT="Top" WIDTH=66 HEIGHT=19></a>
</td>
</tr>
<tr>
<td>
<a href="Widgets.html"><img border=0 src="/images/magelang/back.66x19.gif" ALT="Back" WIDTH=66 HEIGHT=19></A><BR>
<a href="Button.html"><img border=0 src="/images/magelang/next.66x19.gif" ALT="Next" WIDTH=66 HEIGHT=19></a>
</td>
</tr>
</table>
</TD>
</TR>
</TABLE>

<!-- Start PageTop Insert -->
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=466>
  <TR>
    <TD ALIGN="LEFT" VALIGN="TOP">
      <IMG SRC="/images/banner.onlinetraining.465x80.gif" ALT="Online Training" WIDTH=465 HEIGHT=80 BORDER=0><BR>
      <DIV ALIGN=RIGHT><IMG SRC="/images/shdw.gif" ALT="shadow" WIDTH=291 HEIGHT=22><A HREF="/developer/techDocs/knowledgebase.html"><IMG SRC="/images/search.gif" ALT="Search" WIDTH=59 HEIGHT=22 BORDER=0></A><A HREF="/developer/faq/index.html"><IMG SRC="/images/faq.gif" ALT="FAQ" WIDTH=34 HEIGHT=22 BORDER=0></A><A HREF="/developer/feedback.html"><IMG SRC="/images/feedbk.gif" ALT="Feedback" WIDTH=82 HEIGHT=22 BORDER=0></A></DIV>
    </TD>
  </TR>
  <TR>
    <TD HEIGHT=25>
      <!-- spacer -->
      <BR>
    </TD>
  </TR>
<!-- End PageTop Insert -->

<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><STRONG>Component</STRONG></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>