I need to make an application that allows the management of a Hotel, i would like to draw in the interface a calender which contains the dates and rooms, so the user can see which room is available for which date.
JXDatePicker
is intended to use as is, you cannot add any information in the calendar. But you can listen to selection changes and show available rooms in other components such as JList or JTable or even JComboBox.
Adding an ActionListener
JXDatePicker picker = new JXDatePicker();
picker.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// implementation here
}
});
Adding a PropertyChangeListener
JXDatePicker picker = new JXDatePicker();
picker.addPropertyChangeListener("date", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
// implementation here
}
});