This tutorial shows how to programmatically create recurring items using JPlanner.
Follow steps 1 and 2 from the previous tutorial.
Set CurrentView to WeekRange, Date to Jan 1, 2015 and EndDate to Mar 1, 2015, respectively.
Create a new appointment in the window's constructor by adding the following lines of code to the constructor:
Java Copy Code |
---|
Appointment app = new Appointment(); |
The code above creates a new appointment on 10th of January, 2015, starting at 2:00 PM and ending at 4:30 PM.
Now that the appointment is added to the schedule, create a Recurrence object that defines how the appointment recurs. The following code creates and initializes a new Recurrence object and associates it with the item. Add these lines to the window's constructor.
Java Copy Code |
---|
Recurrence rec = new Recurrence(); |
This fragment creates a new recurrence object that continues infinitely and repeats the appointment on Monday and Wednesday every two weeks.
Compile and run the application. The image below depicts what the application output would look like.