OK, here's my suggestion:
Create a GanttEntry. This class is to contain info about one entry.
Create a GanttChart class. This should contain info about the whole chart you want to create:
This should give you the Gantt chart as an Image. Note that there is no setImage medhod, as you want the image to be drawn based on your data.
You might want to draw the image every time getImage is called, or only if image == null, or redraw if ganntEntries have changed since last entry - up to you. You probably need to use some ImageWriter - I konw next to nothing about details of image manipulation in
Java.
To get the data from the database, use any of a multitude of methods (SQL over
JDBC, Hibernate,
EJB 1.0, EJB 2.x, whatever your choice may be), but
you should retrieve it as a Collection of GanntEntry objects:
And, finally, your client could be something like
And yes - I know. I can never make up my mind if Gannt is spelled Gantt or not. Maybe you could use "Gnat"
[ November 30, 2006: Message edited by: �dne Brunborg ]