reusing components in inherited Frame while maintaining GUI builder usage

197 Views Asked by At

what is the best way to have JFrames, JDialogs, etc that derive from a common parent but differ some, to be able to have the common parts update automatically when the parent does, but also have new components which are still easily modified in a GUI builder.

One approach I have used before is having placeholder JPanels that populate with existing isolated components at runtime, but I suspect that this is not the best way.

Example frame visual inheritence:

alt text

1

There are 1 best solutions below

0
On BEST ANSWER
  1. Don't use a GUIBuilder unless you creating some sort of prototype or other throw away code.
  2. Have the components that need to update automatically setup as listeners for some sort of change event. Once an update is needed fire of an "Event" to each listener.