Fullscreen mode and JFileChooser

I have an application that uses fullscreen mode and a JFileChooser. The problem is that whenever the JFileChooser closes it leaves an ugly grey rectangle. Is there any way to avoid this? Maybe if I make the JFileChooser render actively it might work, but I don't know how to do this. Anyone know how?

[308 byte] By [JTeena] at [2007-9-28 1:11:18]
# 1
And repainting the background doesn't work?
DOMOa at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 2
Well, if I call the render method after the file is saved, then it doen't seem to work. However, if I call render based on keyboard input, then it goes away. I have no idea why this is.
JTeena at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 3
BTW, I am using active rendering.
JTeena at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 4
If you're using active rendering, it will repaint the background within a very short time, so there shouldn't be a problem.
DOMOa at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 5
There is.
JTeena at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 6

I would also think if the screen is updated due to active rendering, it should go away, but it doesn't. So it's most probably something else. Is it loading or saving a large file? While loading/saving, depending how large the file, it'll pause for a long while leaving an ugly rectangle, but it should go away after loading/saving. So this is not the case? If it is, maybe you could put it in its own thread. I doubt that helps at all, but I think we need more information. Either some code, or other unusual things going on related to this.

Ceranitha at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 7

Just a thought, but you might try calling repaint() after the JFileChooser closes. If you have paint and update methods that call your render method everything should show up ok, and it might trick swing into getting rid of the grey box.

Or this might not do anything. I'm basically throwing this idea out under the "bang on it 'til it works" theory.

rgeimera at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 8
Well, my program isn't updated on a regular basis, so I need to know when to update so that there aren't any problems.
JTeena at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 9
Well usually when you open a FileChooser, it will wait until you select a file before continuing with code. So after the line where you told it to open a file chooser, put repaint(). swing uses the paint method to draw everything, so repaint should redraw everything.
javatypoa at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...
# 10
Is the background updated, if you move the filechooser?
DOMOa at 2007-7-7 20:46:17 > top of Java-index,Other Topics,Java Game Development...