Skip to content

Commit 11cb72a

Browse files
committed
ADD,COS: MainGUI.makeVisibleOnInstantiation() is created and called...
...from the main constructor. The original behaviour is thus retained. However, derived classes got a chance to change this behaviour by overriding this method.
1 parent 0cf20d4 commit 11cb72a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/ai/nets/samj/gui/MainGUI.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,17 @@ public void windowClosed(WindowEvent e) {
179179
SwingUtilities.invokeLater(() -> go.setEnabled(true));
180180
}).start();
181181
// Make the frame visible
182+
makeVisibleOnInstantiation();
183+
}
184+
185+
/**
186+
* The purpose of this method is two-fold: To make this JFrame visible,
187+
* and to be called from default constructor of this class. So the default
188+
* behaviour is that this JFrame is immediately displayed. However, if
189+
* a class derived from this one needs a different behaviour, that class
190+
* can override this method...
191+
*/
192+
protected void makeVisibleOnInstantiation() {
182193
setVisible(true);
183194
}
184195

0 commit comments

Comments
 (0)