Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
What settings are you using under display, experience, etc.. under options (Remote Desktop Connection)? –  mdeitrick Feb 12 '12 at 13:26
    
Thanks for the edit Journeyman Geek. @Mike: Full Screen, Highest Quality (32-bit), Audio transfer off, Device/Resource sharing fully off, High-speed broadband, Font smoothing, Desktop composition, Visual styles. (That's all) –  ADTC Feb 13 '12 at 3:56
    
I haven't found a solution to rectify this, but upon further testing, I found that Java GUI apps work properly when I set the color depth to anything lower than "Highest Quality (32 bit)" (The available options are 24 bit, 16 bit and 15 bit.) Java has this problem only when I set the color depth to 32 bit. Could someone using Remote Desktop test this please to determine if it's a bug in Java VM? –  ADTC Feb 14 '12 at 9:51
add comment

4 Answers

up vote 0 down vote accepted

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!

share|improve this answer
    
Strangely, Eclipse (Indigo SR1) seems to run just fine. I would still hold on to my speculation that this is a bug in Java VM because when the computer uses the RDP display driver in 32-bit color depth, this problem occurs, but when it uses the Nvidia display driver, it doesn't occur. Perhaps the JVM is having problems when interfacing with the RDP driver in 32 bit color (if anything of that sort actually happens), while no problem with 24 bit and lower? –  ADTC Feb 14 '12 at 14:34
    
That doesn't surprise me (RDP vs. Nvidia), especially after comparing the specs of both display drivers. I think the issue with the JVM would be a memory issue but then again that's just speculation. Regardless, is everything operating properly now? –  mdeitrick Feb 14 '12 at 16:21
    
what do you mean "comparing the specs of both display drivers"? RDP display driver is not for any real hardware. It's a driver used by Windows (of remote client) when I log in to a remote desktop session. So I don't understand what you mean by specs of RDP driver. "is everything operating properly now?" No in 32 bit color depth. Partially yes in anything lower (as explained before). I want to use 32 bit color depth because the window frames switch to Basic theme in anything lower. PS: JVM doesn't complain of any memory deficit. It just screws up the Swing GUI. –  ADTC Feb 14 '12 at 17:16
    
I was confused with your statements "when the computer uses the RDP display driver" and "when it uses the Nvidia display driver"... it sounded as if you were swapping them out or something. My bad. By specs I mean their capabilities. Nevermind my previous post, I misinterpreted your explanation. I'm going to continue researching and I'll let you know if I find anything. –  mdeitrick Feb 14 '12 at 18:31
    
Well, I haven't found anything. As stated before, I have been in situations (I also understand your disappointment) like this before and at the very least I knew my program was running properly when I turned down the settings on the depth. Sigh, I too really wish it would display properly when using higher settings. –  mdeitrick Feb 19 '12 at 20:08
show 1 more comment

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:

share|improve this answer
    
Not sure why this was downvoted. I just tried it because I was having the same issue and it fixed the problem. +1 from me –  StormeHawke Dec 11 '13 at 20:29
add comment

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).

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.