In my Swing application, I want the ability to switch between decorated and undecorated without recreating the entire frame. However, the API doesn\'t let me call setU
calling dispose() releases the native window resources. then you can edit properties like undecorated and so on. then just call setVisible(true) to recreate the window resources and everything works fine (the position and all compoenents won`t be changed)
dispose();
setUndecorated(true/false);
setVisible(true);