I want to have JDialog popping up in my game showing some info and then disappear after 2-3 seconds. Obviously, having a modal JDialog with a “OK” button to close it will get hazzling so therefore I want no such button instead close it automatically.
So, I need show() followed by a sleep and then hide(). If I use modal, then i need the sleep inside the JDialog since modal JDialog stops the outside code until it hide(). But, if I instead use a non modal one and put the sleep outside the JDialog and then close it from outside as well, i get a strange way of the JDialog not painting itself. The text does not get shown on the JDialog unnless it is Modal. Strange. I get kind of the same problems I had (since i use passive rendering) of having to force paint with paintImmediately but in JDialog there is no such method I can use?
What to do?