Solved

A JSlider, XSlider, Is Used to Change an Icon Displayed

Question 59

Essay

A JSlider, xSlider, is used to change an icon displayed in the JLabel jlab. xSlider generates a value between 0 and 9, which is then used to index into String[ ] filename, where filename[i] is the ith image available. So xSlider allows the user to select which image appears. Write the stateChange method for a ChangeListener that would be used to implement the ability to change the image based on the JSlider setting.

Correct Answer:

verifed

Verified

public void stateChange(ChangeEvent ce)
...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions