All pastes #347963 Raw Edit

Mine

public java v1 · immutable
·published 2007-02-09 20:42 UTC
rendered paste body
public class MusicPlayer {	private Player player;	private File file;	private boolean playing;	public MusicPlayer() {			}	public void setFile(File file) {		this.file = file;		player = new Player(new FileInputStream(file));	}		public File getFile() {		return file;	}	public void play() {		if (isPlaying()) {			return;		}				playing = true;				new Thread() {			public void run() {				player.play();				playing = false;			}		}.start();	}	public void stop() {		player.close();	}	public boolean isPlaying() {		return playing;	}}