Using swing frame switch algorithm instead of quick return