what is the best way to have JFrames, JDialogs, etc t开发者_开发问答hat 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:
- Don't use a GUIBuilder unless you creating some sort of prototype or other throw away code.
- 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.
精彩评论