Added window state listener to SwingContainer for dispose events and
optimized the handling of minimize/maximize