Download presentation
Presentation is loading. Please wait.
Published byClifford Sharp Modified over 6 years ago
1
Java Programming JFileChooser AudioPlayer2 Timer RandomAccessFile
2
CLASSPATH tritonus_share.jar javalayer.jar tritonus_mp3.jar
AudioPlayer2.jar
3
Nested classes and Scope
Error: z not in class D scope
4
JFileChooser
5
JFileChooser
6
JFileChooser
7
JFileChooser Implements file open dialog box.
Returns JFileChooser.APPROVE_OPTION if user successfully selects a file. Note that the variable is static (accessed from the class, not the object) It is also final (unchangeable) that is why it is in capitals
8
Import the right packages
9
Fields
10
Constructor setVisible(true); }
11
Method to Define Components
12
JFileChooser definition and use showOpenDialog()
13
OpenDialog() ActionListener
14
A main() method
15
AudioPlayer2 methods import AudioPlayer2.*;
16
Event Dispatch Thread User Actions // Start of EventDispatchThread
win.show(); EventListener ActionEvent e Return to eventListeners ActionListener() actionPerformed()
17
Timed Events // Start of EventDispatchThread Timer Component
win.show(); Timer Component Timer ActionEvent every Delay ms Return to EventListener Timer ActionListener() actionPerformed(){ AudioPlayer2.play() }
18
AudioPlayer2 and Timer
19
AudioPlayer2 and Timer
20
AudioPlayer2 and Timer
21
AudioPlayer2 and Timer // Timer callback nested class
22
AudioPlayer2 methods import AudioPlayer2.*;
23
AudioPlayer2 and Timer // Timer callback nested class
// Play button callback nested class // Stop button callback nested class
24
AudioPlayer2 and Timer // Timer callback nested class
// Play button callback nested class // Stop button callback nested class
25
AudioPlayer2 and Timer // Timer callback nested class
// Play button callback nested class // Stop button callback nested class
26
Random Access File Reading
// Add your checking code here and return value
27
Assignment 2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.