Identify and correct the error(s) below:

The following code should set a JSpinner’s range to include the even numbers from 2–100. The initial value on the JSpinner should be 2.
```
1 yearsJSpinner = new JSpinner(
2 new SpinnerNumberModel( 100, 2, 100, 1 ) );
3 yearsJSpinner.setBounds( 2, 2, 100, 100 );
4 contentPane.add( yearsJSpinner );
```


The numbers on line 2 should be ( 2, 2, 100, 2 ). The first value in the code above would set the initial value to 100, not 2. The final value in the code above sets the step size to 1, where it should be 2 (to generate the even numbers only).
```
1 yearsJSpinner = new JSpinner(
2 new SpinnerNumberModel( 2, 2, 100, 2 ) );
3 yearsJSpinner.setBounds( 2,
4 contentPane.add( yearsJSpinner ); );
```

Computer Science & Information Technology

You might also like to view...

In Impress, ________ displays thumbnail images of each slide

A) the workspace B) the Slides pane C) Normal view D) Title Slide layout

Computer Science & Information Technology

A(n) ____________________ is an internal network that uses Internet technologies.?

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A(n) ________-oriented protocol requires two computers to exchange control packets.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

In Adobe InDesign, you create named colors in which panel?

A. Color panel B. Swatches panel C. Gradient panel D. CMYK panel

Computer Science & Information Technology