Hi, my program displays an interface inside a JFrame and this JFrame has a top bar as what an usual JFrame has. When I used Processing 3, this top bar can be seen either when i run the program inside Processing or export it as application. Now I use Processing 4. I find that this top bar can only be seen when i run it inside Processing but when i export and run it as application the interface is displayed full screen. Thus there is no top bar can be seen and then I lose the ‘close’ button and ‘minimize’ button and become inconvenience. This image shows the difference.
I am sure I did not run any code like frame.setUndecorated(false/true) in my original program. Now, as i lose the top bar, when i add the above code frame.setUndecorated(false) i got the error ‘IllegalComponentStateException: The window is displayable.’
Right now what i can do is to add the following three codes at the moment when the launching page just finishes and before the interface starts executing
Yes, the top bar can be shown again in this way but i suppose this is not a very good approach. There is a short moment that the interface will disappear.
My question is why the top bar shows inconsistent behavior and only disappear when it is run as an exported application by Processing 4? How can i make sure that the top bar can be shown in the exported application?