Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ArrayList<Integer> load() {
- FileReader fr;
- BufferedReader br;
- String line;
- int correct;
- ArrayList<Integer> stats;
- try {
- fr = new FileReader("/home/pilgon-sesh60/code/hello/save.tsv");
- br = new BufferedReader(fr);
- current = Integer.parseInt(br.readLine());
- stats = new ArrayList<Integer>();
- correct = Integer.parseInt(br.readLine());
- stats.add(size() - correct);
- stats.add(correct);
- stats.add(Integer.parseInt(br.readLine()));
- clear();
- while((line = br.readLine()) != null) {
- add(new Card(string.split("\t")));
- }
- } catch (IOException e) {
- e.printStackTrace();
- System.exit(0);
- }
- return stats;
- }
- loadMI = new JMenuItem("Load");
- loadMI.addActionListener(new ActionListener( {
- @Override
- public void actionPerformed(ActionEvent arg0) {
- ArrayList<Intger> stats;
- stats = deck.load();
- remaining.set(stats.get(0));
- correct.set(stats.get(1));
- wrong.set(stats.get(2));
- display.setText(deck.getCurrent().front);
- inputField.setText("");
- }
- }));
- kanjiProgress.add(loadMI);
- public void set(int newVal) {
- count = newVal;
- update();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement