CSSE 221: Fundamentals of Software Development Honors

Programming assignment (due by Sunday, 9:00am)

Finish LightsOut, as stated in the specification, being sure you have checked in your final, fully-documented copy to the repository.

Written homework to do before week 4 (due before beginning of class on Monday, Sept 25).

Answers are to be written in your own words! As usual, please bring hardcopy for written answers to class to hand in on Monday.
  1. Read chapters 17 and 18 from Savitch. You may also want to refer to the Sun Java tutorial on Swing as a reference.
  2. Describe three different choices for LayoutManagers in Swing.
  3. Describe any advantage of having your frame be a subclass of JFrame rather than using JFrame as-is.
  4. What is the difference between paint() and paintComponent?
  5.  
  6. When is it appropriate to use the ActionListener interface? What method must you implement when using it?
  7. Compare and contrast these three Listener interfaces: MouseListener, MouseMotionListener, and ActionListener.
  8. Write a class called MyButton extending JButton. When a button of this type is pressed, it turns another panel, myPanel (stored as a field), the color green.
  9. What is an applet? What is the purpose of an applet (i.e., what can an applet do that a “regular” Java program can’t)?
  10. How can one convert an existing Java GUI program to an applet?
  11. Say you have a compiled applet called MyApplet.class and stored in the same folder as a webpage. What do you have to do specifically to this webpage to have it call/display this Applet? Pick any reasonable size (No one said this course involved only Java…)
  12. Say you wanted to create a two-dimensional dynamically sized 2D array (i.e. a 2D ArrayList). Write a short paragraph speculating how you might tackle this problem.
  13. Additional questions from your classmates are as follows:
  14. What is the difference between JTextField and JTextArea?
  15. What is the relationship between JMenu, JMenuBar, and JMenuItem?
  16. Go and look at the API for MouseListener, MouseMotionListener, KeyListener, and ActionListener. Name one method from each interface.
  17. List the required steps when attempting to implement a specific event listener (pick a listener).
  18. Describe the difference between the Applet and JApplet classes. Include in your answer why it is better to use JApplet.
  19. What are the security advantages of applets (as compared to applications)?
Reminder that assistants are in Moench F217 from 7-9pm on Sunday through Thursday nights to help you.