Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval...

7
Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener can be added to listen for value property change

Transcript of Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval...

Page 1: Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.

Slider A Slider

Lets the user graphically select a value By sliding a knob within a bounded interval

Can show both major tick marks and minor ones A listener can be added to listen for value property change

Page 2: Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.

Example Refer to BouncingBallApp Eclipse project

A slider is added to control the speed of the ball movement

The rate property is bound to The current value shown by the slider

Allowing the rate to vary between 0 and 20

Page 3: Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.

Video and Audio (Media)

Media Used to obtain the source of the media

Currently, JavaFX supports MP3, AIFF, WAV, and MPEG4 audio formats and MPEG-4 video formats

Page 4: Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.

Video and Audio (MediaPlayer)

MediaPlayer Used to control and play the media

Page 5: Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.

Video and Audio (MediaView)

MediaView Displays the video

Page 6: Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.

Example 1 Refer to MediaDemo Eclipse project

Displays a video in a view play/pause button is used to play/pause video Rewind button is used to restart the video Slider is used to control the volume of the audio

Page 7: Slider A Slider Lets the user graphically select a value By sliding a knob within a bounded interval Can show both major tick marks and minor ones A listener.

Example 2 Refer to FlagAnthem Eclipse project

The images for Denmark, Germany, India, Norway, UK, USA

http://cs.armstrong.edu/liang/common/image/

The audio clips for national anthems http://cs.armstrong.edu/liang/common/audio/anthem