Chapter 7-6

1.)Write a code segment that obtains an input from a text field called inputField, converts the input to an integer, and outputs the square root of the integer to a text field called outputField.

2.)Assume that an action listener has been added to button. Which method runs when the user clicks the button.

3.)Describe the roles and responsibilities of the model, view, and controller classes in a GUI program.

Published in: on April 30, 2008 at 4:09 pm  Leave a Comment  

Chapter 6-8

1.)Describe how to set up a timer and explain what it does.
When the timer is sent the start message, its clock starts ticking, when each interval of time passes, the listener’s actionPerformed method is triggered. This method runs the operations to move the object and repaint the panel, because the timer uses the computer’s clock to measure the intervals, they will not vary with the execution speed of the computer.
2.)Describe the factors that affect our perception of the movement of a graphical object.

3.)What causes flicker? How can flicker be eliminated.

4.)How do the direction and velocity of an object determine where it will be placed after a given unit of time

Published in: on April 30, 2008 at 3:58 pm  Leave a Comment  
Follow

Get every new post delivered to your Inbox.