g00se, on 17 September 2010 - 09:46 AM, said:
Just use a Scanner
private javax.swing.ComboBoxModel getInterestRatesModel() {
javax.swing.DefaultComboBoxModel result = null;
String filename = "rates.txt";
java.util.Scanner s = null;
try {
result = new javax.swing.DefaultComboBoxModel();
s = new java.util.Scanner(new File(filename));
while(s.hasNextLine()) {
result.addElement(s.nextLine());
}
}
catch(IOException e) {
e.printStackTrace();
}
finally {
try { s.close() ; } catch(Exception e) { /* ignore */ }
}
return result;
}
Thanks G00se
Now I am on to trying to write a graph chart to show the results.

New Topic/Question
Reply




MultiQuote


|