So my big tip is to create a SwingController base class for any of your UI panes with the following methods:
- JComponent createUI();
- void initUI();
- void resetUI();
- void respondUI(Event anEvent);
Theres a bit more to it than that, since you want resetUI to update all of your components without triggering respondUI(). And you want all your components to be automatically configured to call respondUI() when there is user interaction.I’ve written one of these before, but I don’t have access to a public version anymore. I do all my current UI dev in a UI kit built on top of Swing. But here is what I use there that solves this problem:
https://github.com/reportmill/SnapKit/blob/master/src/snap/v...