Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+19 votes

Just wanted to know ways how the user can save the file and how will they be able to edit it again.

asked in CSC305 Fall 2023 by (1 point)
+3

I believe that going back to the movie tracker would be a fantastic place to start.

1 Answer

+6 votes

When a user saves a plan you can determine the file type it will be saved as:
Sample code
FileChooser.ExtensionFilter filter = new FileChooser.ExtensionFilter("Lesson Plan (.courselessonplan)", ".courselessonplan");
fileChooser.getExtensionFilters().add(filter);

To save the file additionally you may need the Gson package imported, which will save the lesson plan as a JSON object.

When the user loads saved file, it should be loaded to your course plan view as lesson plan of cards. There you should be able to remove cards from the loaded plan, add new cards, etc.
courseLessonPlan = CourseLessonPlan.loadCoursePlan(chosenFile);

courseLessonPlanView.addCardToLessonPlanView(eachCard, selectedLessonPaneNumber); //add to the lesson plan view

answered by (2.1k points)
...