This is an example of how you can work with arrays in JavaTM. It include an example of how to read command line arguments.
You will most likely need to work with Arrays when you create Lab 4.
ArrClass - Source.
ArrClass - Listing.
This is an example of how you can create random numbers. It is also an example of how to simplify complicated functionality of another class by creating a "wrapper class".
Randomizing is also part of Lab 4.
RandCl - Source.
RandCl - Listing.
This is an example of how to create menus. You guessed it.....necessary for Lab 4.
Menus/MenuEx.java - Source.
MenuEx - Listing.
This is an example of how to use a timer.
You should use a timer for Lab 4.
TimerEx - Source.
TimerEx - Listing.
This is an example of how to use a CardLayout Layout manager.
CardLay - Source.
CardLay - Listing.
This is how to use a GridBag Layout. Note that the GridBag layout gives you the most control over placement and adjustment of components, however it is also the most complicated to use.
GBLayout - Source.
GBLayout - Listing.
Read pages: 407-439 (Arrays); 759-766 (Menus); 186-187 (Random Class)
Questions? Email me:mcccjava@hotmail.com
SunTM, Sun MicrosystemsTM, the Sun Logo, and JavaTM are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.