0

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

brian_d
  • 11,190
  • 5
  • 47
  • 72

1 Answers1

2
  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.
jzd
  • 23,473
  • 9
  • 54
  • 76