I need a simple way to implement a Calendar (similar to google calendar) in java. The calendar must display Monday – Sunday at the top and each hour as a row.
Monday | Tuesday | Wednesday
08:00
09:00
10:00
11:00
How would one create a calendar in Swing like that? I’m using Netbeans IDE. Each column should be able to hold some text.
Could I just use the table component in swing? If so, can i modify it to meet my needs?
You would probably want to think about using
JTable. You can use anAbstractTableModelto define the dimensions of the table, as well as some other properties, then you can fill in the top row and first column with the desired values. You can also set certain parts of the table editable by your users, in the event that you wanted to be able to input data into the calendar.For more info, take a look at the JTable documentation.