Fra java API:
public void setVisible(boolean b)
Shows or hides this Window depending on the value of parameter b.
Overrides:
setVisible in class Component
Parameters:
b - if true, makes the Window visible, otherwise hides the Window. If the Window and/or its owner are not yet displayable, both are made displayable. The Window will be validated prior to being made visible. If the Window is already visible, this will bring the Window to the front.
If false, hides this Window, its subcomponents, and all of its owned children. The Window and its subcomponents can be made visible again with a call to #setVisible(true).
~
Link til JFrame APIVinduet bliver ikke tegnet, men kører stadigvæk i baggrunden. Og kan fås frem igen, ved at kalde metoden med true. En grund til at man kan have dette er fordi at det er hurtigere og kræver mindre hukommelse at genbruge de objekter, man i forvejen har i stedet for at lave nye.
Hvis du for eksempel gerne vil lave en applikation, hvor du har flere forskellige vinduer, så har du mulighed for at genbruge nogle af de gamle vinduer.