public Task getSelectedTask(int ID) {
        Task task = null;

        for (int i = 0; i < tasks.size(); i++) {
            if (tasks.get(i).getTaskID() == ID) {
                task = tasks.get(i);
            }
        }
        return task;
    }