What does the following code do? Assume that monthsJSpinner has been declared.

```
1 private void createUserInterface()
2 {
3 yearsJSpinner.addChangeListener(
4
5 new ChangeListener() // anonymous inner class
6 {
7 // event handler called when yearsJSpinner is changed
8 public void stateChanged( ChangeEvent event )
9 {
10 yearsJSpinnerStateChanged( event );
11 }
12
13 } // end anonymous inner class
14
15 ); // end call to addChangeListener
16
17 } // end method createUserInterface
18
19 private void yearsJSpinnerStateChanged( ChangeEvent event )
20 {
21 monthsJSpinner.setValue( new Integer( 1 ) );
22
23 } // end method yearsJSpinnerStateChanged
```


When the value in yearsJSpinner is changed, the value in monthsJSpinner is set to 1.

Computer Science & Information Technology

You might also like to view...

It is helpful to name your basic custom slide show as Main, Major, or Primary in order to easily identify it

Indicate whether the statement is true or false

Computer Science & Information Technology

A slide layout can be ________ to help identify its purpose for users

Fill in the blank(s) with correct word

Computer Science & Information Technology

If you have statistics on the expected frequency of condition evaluations, you should use them to make your program faster and more efficient.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The Chart Tools appear on the Ribbon with three contextual tabs that do NOT include ____.

A. Design B. Layout C. Style D. Format

Computer Science & Information Technology