I am tasked with creating several JPanels each of which has a title centered at the top. As such I have created parent panel
that each panel extends. However, I am uncertain as to
whether drawing the string on the panel or using a JLabel
is the best solution. I would greatly appreciate any advice on this matter
If i were doing it, I will use:
BorderLayout for the outer JPanel (hence the title JLabel goes in the NORTH)
Have panel(s) to do the rest of the items and put in CENTER (these panels can each have its own layout managers)
Thinking about it, your title can indeed be a JPanel itself and in its own class. That way you can reuse it.