-
Hello fellow programmers. I am writing a GUI application in JAVA that can write notes and read them, add them to a text file and etc.
My problem: GUI Application reads and finds the note.txt file but does not add the writen text to it. Here is one of the classes from my project that is responsible for adding and reading notes (I think the error comes somewhere from there, shame that I can’t add the whole project here): import java.io.BufferedWriter; /** ArrayList<Note> allNotes = new ArrayList<>(); AllNotes() { public final int getMaxID() { private void readAllNotes() { readNotes = readTextFile(appDir + fileSeparator + “\Notes.txt”); if (!“File not found”.equals(readNotes.get(0))) { Note n = new Note(); allNotes.add(n); /*int nid = Integer.parseInt(tmp[0]); if (nid > maxID) { } public void addNote(int maxID, String course, String note) { public ArrayList<Note> getAllNotes() { private void writeAllNotes() { for (Note n : allNotes) { public String searchAllNotesByKeyword(String noteList, int i, String s) { if (allNotes.get(i).getNote().contains(s)) { return searchAllNotesByKeyword(noteList, i + 1, s); } |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi @justcain, Welcome to the Github Community Forum! Do you have a github repository? So we can analyze better your code! -Gabriele- Mark helpfull posts with Accept as Solution to help other users locate important info. Don’t forget to give Kudos for great contents! |
Beta Was this translation helpful? Give feedback.
-
Just created it. Pretty new to github ;d Feel free to give advice in any other parts of the code. |
Beta Was this translation helpful? Give feedback.
-
Is this the repository? https://github.com/justcain/GUI-Easy-snippets -Gabriele- Mark helpfull posts with Accept as Solution to help other users locate important info. Don’t forget to give Kudos for great contents! |
Beta Was this translation helpful? Give feedback.
-
Yes it is. The classes are in the SRC folder. |
Beta Was this translation helpful? Give feedback.
-
Missing File.CreateNew() in WriteAllText. |
Beta Was this translation helpful? Give feedback.
Missing File.CreateNew() in WriteAllText.