You are mixing up isShowing()
and isVisible()
. visible
is just a boolean
property but showing
implies actually showing on the screen and AWT components are never showing when they are just de-serialized. You have to invoke setVisible(true)
on the Window
ancestor of the component hierarchy (i.e. the JFrame
) after de-serialization to make it showing.
Just consider Component.isShowing()
:
Determines whether this component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing.
and Window.isShowing()
:
Checks if this Window is showing on screen.