So 1 out of 150 application launches causes a deadlock in the java vm. I traced the code down to a single line
w.setBackground(Color.GREEN);
Where w is a Window object.
Like I said this does not happen each and every launch just 1/150.
What I mean by deadlock is in my terminal window I can do ctrl C and there is no response :o. Ctrl Z kills the process but leaves the window open (in fullscreen … with no decorations I mind you).
Any ideas? Maybe a delay from creating the window to changing properties?
I Create a JFrame. Remove decoration and remove re sizable so it is a plain screen. Then I set the full screen window of the graphicsdevice to the jframe. Then I use getFullScreenWindow and set font, background, and foreground in that order. Deadlock occurs at the set background. Figured if I commented it out it would just lock up at the set foreground. I probably am not setting enough time between creating the full screen window and getting it again. Its probably giving me some other window.
While I’d agree with everyone telling you to put everything on the EDT, that still might not fix the problem. Why are you not setting up all the properties (font, foreground, background, etc,.) on the frame prior to making it fullscreen? Various things I’ve read (though nothing I’d call concrete proof - anyone?) suggest that bits of FSEM can / will happen asynchronously, and the window might not be fully set up by the time you call getFullScreenWindow(), and therefore the native peer not in any mood to play ball!
Thanks for the sample. I was doing those in that order. I set what settings that I could in the EDT. Then what I couldn’t I set ater a short delay. I have yet to encounter a deadlock.
Sometimes a hack is required XD. As long as I don’t get a lock while developing I am cool. I will look into it more in detail after most - all of the core features are finished before I start making content.