private void saveFile(File file) { try { BufferedWriter writer = new BufferedWriter(new FileWriter(file)); for (QuizCard card : cardList) { writer.write(card.getQuestion() + "/"); writer.write(card.getAnswer() + "/n"); } } catch (IOException ex) { System.out.println("Couldn't wirite the cardList out"); ex.printStackTrace(); } }
private void showNextCard() { currentCard = cardList.get(currentCardIndex); currentCardIndex++; display.setText(currentCard.getQuestion()); nextButton.setText("Show Answer"); isShowAnswer = true; }