This is a calendar application built using Java and JavaFX. It allows the user to select a month and year, and displays a calendar for that month. The user can also enter text for a specific date and save it, so that the text can be retrieved when the same month and year are selected.
- Java 11 or higher
- JavaFX 11 or higher
- Clone or download the repository to your local machine.
- Open the project in your preferred Java IDE.
- Run the
Calendarclass located in thecalendarpackage. - Select a month and year from the respective dropdown menus.
- Click on a date to view or enter text for that date.
- Click the "Save" button to save the text for that date.
- To view the text for a previously saved date, select the same month and year and click on that date.
The code is split into three main classes:
CalendarData: This class contains aHashMapthat stores the text for a given date as the value, with the date as the key. It has two methods:setData(Calendar date, String data): This method allows the user to set the text for a specific date. It takes aCalendarobject as the first argument and aStringobject as the second argument.getData(Calendar date): This method returns the text for a specific date. It takes aCalendarobject as the argument and returns aStringobject.
Calendar: This class extends theApplicationclass from JavaFX and serves as the entry point for the application. It sets up the main window and loads the FXML file for the calendar interface.CalendarController: This class contains the logic for the calendar interface. It has several methods that handle user input and control the behavior of the calendar. Some of the notable methods are:monthPressed(ActionEvent event): This method is called when a month is selected from the month dropdown menu. It sets the selected month in theCalendarobject, and calls thenumberOfDaysInMonth()method.yearPressed(ActionEvent event): This method is called when a year is selected from the year dropdown menu. It sets the selected year in theCalendarobject, and calls thenumberOfDaysInMonth()method.savePressed(ActionEvent event): This method is called when the "Save" button is clicked. It saves the text from the text area to theCalendarDataobject using thesetDatamethod, with the current date as the key.createDaysBtns(int daysInMonth): This method generates buttons for the dates in the calendar, based on the number of days in the selected month. It also adds event listeners to the buttons that display the text for the corresponding date when clicked.
There are no known issues at this time.
● Software developer with knowledge in Java, C, Python.
● Experience developing projects using: Java, C, JavaFX, Git, GitHub etc.
● B.Sc. Computer Science Student at The Open University of Israel.
