swing-menu-corr.sh

Since GTK 3 has been introduced Java Swing applications have a bug in displaying their menus when using the GTK Look and Feel (LaF).

At Linux Mint Cinnamon:

  • No border around dropdown and context menus
  • Wrong font color of activated checkbox and radiobutton menu items (the font has the same color as the background and appears invisible)
  • No menu separators

The script swing-menu-corr.sh fixes this problem.

 

This How-To shows how to fix the problem and offers a bash script to get rid of this problem on Mint 17 and later automatically.

The animated screenshot below shows the problem before and after the fix.

Menübug in Swings GTK LaF vor und nach der Fehlerbeseitigung

Menu bug in Swing’s GTK LaF befor and after the fix

The problem

The problem are entries in the “menus.rc” files of the Mint-themes at /usr/share/themes/[mint-theme]/gtk-2.0/style.

What the script does exactly and how to correct it manually is shown in the article Korrekte Javas Swing Menüs im GTK LaF von Linux Mint.

The script

The bash script swing-menu-corr.sh does the changes in all files automatically.

Swing-menu-corr.sh-Skript

Swing-menu-corr.sh-script v1.0.0

The script corrects Mint-X and Adwaita themes on Mint 17 or later.  Linux Mint 18’s Mint-Y themes are not supported. They do not show the problems in question.

The script creates backup files of all changed files. You can undo the changes of swing-menu-corr.sh with the script swing-menu-undo.sh automatically.

Furthermore the script checks if it runs under Linux Mint. If not, it displays a warning. But do not worry. swing-menu-corr.sh cannot damage your system. The “undo” script swing-menu-undo.sh can bring back the original files anyway.

swing-menu-corr.sh was successfully tested under Linux Mint 17.x, 18.x, 19.x, 20.x with Cinnamon desktop and should also correct problems with Mate or XFCE.

License

The script is licensed under GNU Public License 3.0.

Download

logo_mint  swing-menu-corr.sh and swing-menu-undo at GitHub

Download

 

Logo JavaJava-Test program “Menutest.tar.gz”

Download