I am trying to create a new java swing component, I understand that I could find one that does what I need on the Internet, but it is partly an exercise for me to learn how to do it.
I want to create a swing component that represents a Gantt chart. It would be nice (although it’s not necessary that people can interact with it (for example, sliding tasks for setting timings)
it seems that the best approach for this is to subclass JComponentand override PaintComponent()to “draw an image” of what the diagram should look like, as opposed to doing something like trying to hush everything up to normal JTable.
I read several books on this subject, and also looked at some examples (primarily such as JXGraph), but I'm curious about a few things
When do I need to switch to using UI delegates, and when can I just mess around in paintcomponent() to display what I want?
if I want other swing components to be sub-elements of my component (e.g. I wanted to have a text box on the gantt diagram)
- Can I no longer use paintComponent ()?
- Can I arbitrarily position them in the Gantt chart, or do I need to use the usual layout layout manager
Thank you very much in advance.
-ACE
source
share