简体   繁体   中英

Java Swing GUI Not Displaying in Xmonad

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?

In ~/.xmonad/xmonad.hs add import XMonad.Hooks.SetWMName .

Then add startupHook = setWMName "LG3D" to tell Xmonad to use LG3D as the window manager name.

xmonad $ defaultConfig
  { ...
    startupHook = setWMName "LG3D",
  }

Lastly, restart Xmonad using mod-q to reload xmonad.hs.

Sources:

http://thinkingeek.com/2012/01/24/fix-java-gui-applications-xmonad/

http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-SetWMName.html

For a 100% explicit answer, just paste this into ~/.xmonad/xmonad.hs :

import XMonad
import XMonad.Hooks.SetWMName

main = xmonad defaultConfig
    { startupHook = setWMName "LG3D" }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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