https://www.cs.usfca.edu/svn/< your username >/cs112/proj3
https://www.cs.usfca.edu/svn/ejung/cs112/proj3
Project 3 MP3 Jukebox is to develop a simple MP3 player with a graphical user interface. This project will help you learn how to implement an interface, how to pass values and return meaningful outcomes between classes, and how to use some Graphic User Interfaces features.
You will need to write two classes, JukePlayer and JukeBoxControls. Use JukeBox.java in Chapter 10 for the main method (do not change this class), and use JukeBoxControls.java in Chapter 10 to see what GUI components you can use. JukePlayer implements MP3Player interface, and JukeBoxControls will use JukePlayer to play given files. Note that your JukeBoxControls should not use JLayer directly, but only through your own JukePlayer. Eclipse might complain about serialVersionUID of JukeBoxControls. You can ignore this warning for this project.
An example execution video is here.
Use DisplayFile.java in Chapter 9 to learn how to use JFileChooser.
You will need to use JLayer for mp3 player. Download, unzip, and add jl1.0.1.jar. (In Eclipse, right clickon proj3 project and select Build Path. Select "Add External Archives". Navigate to the jar and click Open).
Once the play starts, your program will become unresponsive while the song is played. For a stop button to work in the middle of playing, you need to spawn a thread for the player. Here is how to start a thread.
InputStream is = new InputStream(file);
player = new Player(is);
Thread t = new Thread() {
public void run() {
try {
player.play();
} catch(Exception e) {
e.printStackTrace();
}
}
};
t.start()
Grading