5

I thought this question fits SuperUser more than StackOverflow because it's not about actual Java programming, though programmers might be more likely to encounter the problem. Anyway, let me start of with some stats before I ask the actual question:

Laptop:

  • Windows 7 x32
  • Screen resolution 1024 x 768; Nvidia GeForce Go 6200
  • Connected to desktop via ad-hoc wireless network
  • Access internet via desktop

Desktop:

  • Windows 7 x64
  • Screen resolution 1920 x 1080
  • Connected to laptop via ad-hoc wireless network
  • Access internet via cable modem

I'm connecting to my laptop via Remote Desktop from my desktop to take advantage of the large screen. I'm doing programming on my laptop (for portability reasons). Everything else runs smooth and fast over Remote Desktop as both computers are connected directly over the ad-hoc wireless.

The only problem is this: Java Swing apps don't display the GUI properly. I acquired a Java Swing application and I'm debugging it in Eclipse. Here's what I got when I ran the app:

enter image description here

Apparently there doesn't seem to be anything wrong with the GUI application I'm debugging, because the Java Control Panel exhibits the same problem.

I've searched high and low in Google about this; the closest I came to a solution is this. But sadly, the use of -Dsun.java2d.nodraw=true has no effect at all.

This only happens over Remote Desktop. I have tried locally and the GUI apps display properly. This isn't a dealbreaker for me as I can stop using Remote Desktop when developing Java Swing apps. However, I would like to know if anyone has encountered this and found any solution.

PS: All software involved (Eclipse, Java JRE, etc.) are latest versions.

ADTC
  • 3,044

6 Answers6

6

I simply changed the color to 32 bit in both my desktop and RDP client and Java looked perfect.

6

I had the same problem and changing the color depth did not work for me. This:

-Dsun.java2d.d3d=false

seemed to work for me:

JayFar
  • 61
3

I can tell you that in the past I have had to set the color depth a little lower than the highest setting when viewing certain applications via remote desktop connection such as Eclipse.

In regards to a possible bug in the Java VM, refer to this answer for more information. I highly doubt this is the case since you haven't received any error messages pertaining to the inability of creating a Java Virtual Machine... but it's still worth checking out!

2

My same problem was fixed after I logged off windows and logged on again for the user connected to Remote Desktop (NOT merely disconnecting from Remote Dekstop).

user43308
  • 121
2

I had a situation where my Java GUI would fail to paint completely, that is, all of the contents of the main window were stale and would not refresh when running on remote desktop.

Adding

-Dsun.java2d.d3d=false

also fixed it for me.

1

I tried to start a Docker Image with auto install IntelliJ or Eclipse within the Container but i always got a blank content window for privacy, license and installation. I did this on a CentOS 7 Machine logged on via RDP Connection.

Then i saw that local installed Application OpenJdk Privacy Tool has the same problem, it starts but it does not show the content of the App, no buttons, no text...just a blank white screen.

I did search by google and find some workarounds which all does not help.

xhost + initx startx _JAVA_AWT_WM_NONREPARENTING=1 export DISPLAY=localhost:10.0 (and different more solutions around this)

I did try to install compiz and so on......nothing does help!

The Solution:

When connecting via RDP to the CentOS Machine set the Color max. Depth to High Color 16 Bit - not more (not 24 Bit, not 32 Bit)! Then you will see the content of such Apps/Programs using Swing / Awt / Java which has this content showing problem!