When setVisible(true) and setVisible(false) is used for my JDialogs, they often have a white bakground flashin by in the area intended for the JDialog.

For instance, i setVisible(false), i see one white rectangle (same loaction and size as my JDialog) for fractions of a second before the JDialog is gone.

Swing is double buffered, but the showing of JDialogs on top of other UI seems to be not? I could solve this if this white color could be set because I could then set the color to (0, 0, 0, 0) with 0 alpha no one would see it. BUT, it seems I cannot change this color. Even if I this.setBackground(Color.red) on my JDialog it will be white!

I don't think Java 6 changes the language, so any editor that works with Java 5 should work with Java 6. Eclipse seems to work just fine.

It's kind of strange that Java 6 made your game slower. Try running the game with the argument "-Dsun.java2d.d3d=false". For one of my games, this made it alot faster. It's possible that the "feature" that's being turned off by that argument didn't exist (or was off by default) in Java 4.

so, very simple, the class has 2 buttons, one yes and one no and apparently stores the result so that the game can read it. When the this.setVisible(false) is execute, The next frame that gets painted when it closes is the screen like it looked before i opened the dialog BUT the area where the dialog sat on is a white rectangle.

I understand that this is some kind of buffer problem that when the dialog releases control of the buffer. I know that I start using some buffering technique so solve it but I wonder if there was any elegant solution to this that means Swing will handle it without interfering.

I tried to (from outside the dialog code) paint over the dialog and then close it afterwards but still when i close it (despite the jdialog being invisible!) the white rectangle appears.

I localised the bug. Apparently it is a infamous bug under the name "gray rectangle bug". I read that the Java 6 solved that problem. So, I took my code and compiled plus ran in Java 6.

Yes, it now works, the new Java 6 handles the buffering better so i get no strange rectangles showing... but I lost like LOTS of speed!!! I even ran a profiler software and it was like everything from mouse click resposner, calculations, drawing the display took LOTS of more time!

I used as much swing components I could and been very careful not to use any deprecated stuff or to use methods that they warn will not be compatible with future releases. Anyone has experience converting from Java 1.4 or Java 5 to Java 6 and can give me some advice ?

Oh, also. When I run and comile it in Java 6 I have no errors, just some warnings like "blahblahblah is not being used" so there should not be any strange code.

Another strange thing is. If I compile and run manually from the command prompt, my project compile+run with JSDK1.4, but not with Java5 or Java6 (i compile in 5 + run in 5, or i compile in 6 + run in 6) and I cannot make it work with my Install4j either. The only place where I can make my game run with Java 6 run is with Eclipse.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org