Java Replace Line In Text File
How do I replace a line of text found within a text file? I have a string such as: Do the dishes0 And I want to update it with: Do the dishes1 (and vise versa) How do I accomplish this? ActionListener al = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JCheckBox checkbox = (JCheckBox) e.getSource(); if (checkbox.isSelected()) { System.out.println("Selected"); String s = checkbox.getText(); replaceSelected(s, "1"); } else { System.out.println("Deselected"); String s = checkbox.getText(); replaceSelected(s, "0"); } } }; public static void replaceSelected(String