Removed JOptionPane from toTextFile() method