Thursday 15 August 2013

java - Dynamically show and hide JFrame decorations -


I am developing a Java swing-based application with different perspectives. Jeffreem) do not want to be decorated, while in other perspective I want to decorate the window. In other words, I have to change the decoration feature dynamically.

I have tried using setUndecorated (false) and setUndecorated (true) , but I think that by actually showing the window First I can set it only once.

Is there any way to get this?

From Javadoc:

The decoration disabled or enabled for this frame This method can only be called when the frame is not displayed.

Therefore, once the JFrame is displayed and / or displayed, you can not change that value. If you want to change the unmarked to JFrame , then you will need the settlement () first, then change the state and finally it Make the show visible again.

No comments:

Post a Comment