简体   繁体   English

Java Web Start应用程序在XMonad上显示空窗口

[英]Java Web Start application shows empty window on XMonad

I use XMonad+gnome as window Manager. 我使用XMonad + gnome作为窗口管理器。 I have the problem that, when I run a Java Web Start applicacion, It olways show an empty window, like the screen: 我有一个问题,当我运行Java Web Start应用程序时,它总是显示一个空窗口,例如屏幕:

屏幕

Is there something I can do to fix it? 有什么我可以解决的吗?

UPDATE: 更新:

I tried simple programs from JWS Examples and it works, right. 我尝试了JWS示例中的简单程序,它可以正常工作。 So it should be a problem of the application. 因此,这应该是应用程序的问题。

The failed aaplication is Blast2Go. 失败的应用是Blast2Go。

将窗口管理器的名称更改为类似LG3D的已知LG3D

startupHook = setWMName "LG3D"

I had the exact same problem with my own Java code and using the other suggested solutions (setWMName, MToolkit, etc.) did not solve the problem with Xmonad. 我自己的Java代码遇到了完全相同的问题,使用其他建议的解决方案(setWMName,MToolkit等)不能解决Xmonad的问题。 I must note that in other window managers (eg fluxbox), the app works as expected. 我必须注意,在其他窗口管理器(例如,fluxbox)中,该应用程序按预期运行。 In my case, however, I figured out the problem. 但就我而言,我发现了问题所在。 If you have access to the source of the Java app, I suggest you consider the following: 如果您有权访问Java应用程序的源代码,建议您考虑以下因素:

If you have any JFrame or JPanel or other containers, you should explicitly define their layouts. 如果有任何JFrame或JPanel或其他容器,则应显式定义其布局。 If you set the layout to null, then the dimensions of the container must be set explicitly. 如果将布局设置为null,则必须显式设置容器的尺寸。 Otherwise, the container won't be rendered at all. 否则,将根本不会渲染容器。 For instance, I have a JPanel that contains all my widgets. 例如,我有一个包含所有小部件的JPanel。 I'd rather have full control over the layout, so I set the layout to null, and then explicitly set the dimensions for the JPanel: 我宁愿完全控制布局,所以我将布局设置为null,然后显式设置JPanel的尺寸:

jContentPane.setLayout(null);
jContentPane.setPreferredSize(new Dimension(appletWidth,appletHeight+100)); 

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM