<HTML> <HEAD> <!-- Change the Title please --> <TITLE>AWT SHORT COURSE: ActionEvents</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="EventConvenience.html"><img border=0 src="/images/magelang/back.66x19.gif" ALT="Back" WIDTH=66 HEIGHT=19></A><BR> <a href="EncapsulatingBehavior.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="Action Events"> <font size=+1><STRONG>Action Events</STRONG></font><P> </a> Activating a Component, such as a Button, generally triggers the method <tt><pre> public boolean action(Event e, Object arg); </pre></tt> for that Component. The arg parameter depends on the Component that was activated. The following table summarizes the values: <p> <center> <table border> <th>Component</th><th>arg type</th><th>description</th> <tr> <td>Button</td><td>String</td><td>The label of the Button.</td> <tr> <td>Checkbox</td><td>Boolean</td><td>The new state of the checkbox.</td> <tr> <td>Choice</td><td>String</td><td>The selected item.</td> <tr> <td>List</td><td>String</td><td>The selected item.</td> <tr> <td>TextArea</td><td>String</td><td>The text in the TextArea.</td> <tr> <td>TextField</td><td>String</td><td>The text in the TextField.</td> </table> </center> <p> Related Exercise(s): <ul> <LI><A HREF="../Exercise/FormElement/index.html"> FormElement</A> <LI><A HREF="../Exercise/RegistrationForm/index.html"> RegistrationForm</A> </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>