reading a file that is inside the main .jar
This is a piece of my code:
try{
FileReader frd = new FileReader("NL-FR");
BufferedReader brd = new BufferedReader(frd);
boolean finished = false;
String strLine = new String();
while (!finished){
strLine = brd.readLine();
if (strLine == null)
finished = true;
else{
/*
* Here a map with the original word as key
* and the possible translations as values
* The keys are then put seperately in an array
*/
String[] strAnswers = strLine.split(";");
String strKey = strAnswers[0];
String[] strValues = new String[strAnswers.length - 1];
for (byte i = 0; i < strAnswers.length - 1; i++){
strValues[i] = strAnswers[i+1];
}
mapDictionary.put(strKey,strValues);
}
}
}catch(IOException e){
lblCorrect.setText("ERROR: while reading file...");
}
Set<String> set = mapDictionary.keySet();
strQuestions = new String[set.size()];
set.toArray(strQuestions);

