I'm using Java2D for a game I'm writing and haven't had any issues using it until I started integrating it with other swing components. My problem is when the first component I add to the JFrame is not the canvas I'm drawing to, I get a weird artifact that shows up when I mouse over the scroll bar for the textpane. It happens every time I execute the application. When I have the canvas first, there's no problem.
For some reason this appears to only occur on Windows when the default Java2D pipeline is in use (which happens to be sun.java2d.d3d=true), and the artifact occurs. When I set sun.java2d.opengl=true or sun.java2d.noddraw=false AND sun.java2d.d3d=false, then it does not occur.
I'm guessing this is some kind of bug with the Direct3D Java2D pipeline? I can easily work around it, but curious to know if anyone else has run into such an issue? I'm running the latest JDK7u7, but it happens with previous versions as well. I should note that if I minimize the window and restore it, the artifact goes away and never returns until I restart the application.
with artifact:
with no artifact (after adding the canvas first instead of the JLabel image):
If someone has any further info on this I'd appreciate it. Thanks!