EDIT - >>>>>>>>>> RESOLVIDO!!!!!!!!!!!!
E ae galera to com um problema q o eclipse nao ta achando o arquivo .txt, esta assim a estrutura.
JukeBox
|>src
|>package
|>JukeBox1.java
|>SongList.txt
eu criei o arquivo song list pelo >new>untitled text file
O codigo é o seguint
import java.io.*;
import java.util.*;
public class JukeBox1 {
ArrayList<String> list = new ArrayList<String>();
public static void main(String args[]){
new JukeBox1().go();
}
public void go(){
getSongs();
System.out.println();
}
void getSongs(){
try{
File file = new File("SongList");
BufferedReader reader = new BufferedReader(new FileReader(file));
String line = null;
while((line= reader.readLine()) != null){
addSong(line);
}
}catch(Exception e){
e.printStackTrace();
}
}
void addSong(String lineToParse){
String[] tokens = lineToParse.split("/");
list.add(tokens[0]);
}
}
flw
EDIT - >>>>>>>>>> RESOLVIDO!!!!!!!!!!!!
