Never derive from JDialog, JFrame or JInternalFrame for defining your forms, dialogs...
Rather derive from JPanel. This will bring you the follwing advantages:
- possibility to later change from a
JFrame to a JDialog for instance
(because user changed his mind)
- you can reuse one panel instance from one JDialog to another (JDialog are generally not reusable because they are constructed with a reference to their "parent", a frame or another dialog)
- you can later on change replace
JDialog with a more functional
subclass from a 3rd-party framework.