I have a Java swing GUI that runs and displays fine using other window managers but when I run it in Xmonad it does not display correctly. All that displays is the frame of the window which is grayed out with no buttons, menus, etc. How can I make the Swing GUI display correctly?
我有一个Java swing GUI,使用其他窗口管理器运行并显示正常,但是当我在Xmonad中运行它时,它无法正确显示。所有显示的是窗口的框架,它没有按钮,菜单等灰显。如何正确显示Swing GUI?
2 个解决方案
#1
9
In ~/.xmonad/xmonad.hs
add import Monad.Hooks.SetWMName
.
在〜/ .xmonad / xmonad.hs中添加导入Monad.Hooks.SetWMName。
Then add startupHook = setWMName "LG3D"
to tell Xmonad to use LG3D
as the window manager name.
然后添加startupHook = setWMName“LG3D”告诉Xmonad使用LG3D作为窗口管理器名称。
xmonad $ defaultConfig
{ ...
startupHook = setWMName "LG3D",
}
Lastly, restart Xmonad using mod-q to reload xmonad.hs.
最后,使用mod-q重新启动Xmonad以重新加载xmonad.hs。
Sources:
资料来源:
http://thinkingeek.com/2012/01/24/fix-java-gui-applications-xmonad/
http://thinkingeek.com/2012/01/24/fix-java-gui-applications-xmonad/
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-SetWMName.html
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-SetWMName.html
#2
1
For a 100% explicit answer, just paste this into ~/.xmonad/xmonad.hs
:
要获得100%明确的答案,只需将其粘贴到〜/ .xmonad / xmonad.hs中:
import XMonad
import XMonad.Hooks.SetWMName
main = xmonad defaultConfig
{ startupHook = setWMName "LG3D" }
#1
9
In ~/.xmonad/xmonad.hs
add import Monad.Hooks.SetWMName
.
在〜/ .xmonad / xmonad.hs中添加导入Monad.Hooks.SetWMName。
Then add startupHook = setWMName "LG3D"
to tell Xmonad to use LG3D
as the window manager name.
然后添加startupHook = setWMName“LG3D”告诉Xmonad使用LG3D作为窗口管理器名称。
xmonad $ defaultConfig
{ ...
startupHook = setWMName "LG3D",
}
Lastly, restart Xmonad using mod-q to reload xmonad.hs.
最后,使用mod-q重新启动Xmonad以重新加载xmonad.hs。
Sources:
资料来源:
http://thinkingeek.com/2012/01/24/fix-java-gui-applications-xmonad/
http://thinkingeek.com/2012/01/24/fix-java-gui-applications-xmonad/
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-SetWMName.html
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-SetWMName.html
#2
1
For a 100% explicit answer, just paste this into ~/.xmonad/xmonad.hs
:
要获得100%明确的答案,只需将其粘贴到〜/ .xmonad / xmonad.hs中:
import XMonad
import XMonad.Hooks.SetWMName
main = xmonad defaultConfig
{ startupHook = setWMName "LG3D" }