Swing Works different on different Platform

一世执手 提交于 2019-12-11 05:19:45

问题


I have made a Screen Recorder using Java Swing and Xuggler 5.4. I have developed it in Windows 8 64 bit. It's working excellent for Windows. But at client side on Linux's environment , nothing is working. I have searched thoroughly but not getting any solutions. I have checked this thread , but it didn't work for me.

Then I tried to create simple Transparent window in Linux but it's also not working. I was not able to click through the Resizeable Panel. I have used the same JRE version (1.7) for both. Have I miss understood Java's Cross Platform Support as far as Swing is concerned? Please Give Me Some Advice...


回答1:


I have always found logging to be the best debugging tool at your disposal! Many a times, java debuggers take you into APIs where you need not go every time. Logging values of your variables, and generic 'I have reached till this point' statements make life a lot easier.

So, I suppose you have ample logging done in your code. That could give you clues on what's happening on your client's system. Are the right environment variables set? Are they pointing to the correct Java versions you need. If there are some specific Screen capturing requirements(plugins / modules / API) your code has, are they available on the Linux m/c? Like @MadProgrammer said, in the end, Java has to talk with the native graphics APIs to render your screen. I would try to debug it in this way -

  1. Check whether my main screen loads or no(by disabling the screen capture functions for a while).
  2. if not, dig deeper.
  3. Check whether all necessary components for capturing screen(audio and video) are available.
  4. Check whether the code is being run with appropriate permissions to control the h/w devices you may need.


来源:https://stackoverflow.com/questions/25009276/swing-works-different-on-different-platform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!