Swing Nimbus components visual glitch

54 views Asked by At

I'm developing a Java GUI and everything was fine however I got a new laptop to work while I am away from home.

I installed Linux (Ubuntu 19.04) and Oracle JDK 8.

Once I started to work on the application I saw that it was full of visual glitches (the GUI is using Nimbus Look and Feel) which I do not see at my home desktop

Most swing components are visually glitched, such as buttons, list headers and comboboxes

Here is a screenshot: https://i.stack.imgur.com/QDGgs.png

This is a recent thing because I never experienced this before. Below is the code I use to set the Look and feel

I should also mention my laptop is using AMD Vega Graphics (not sure if it is relevant here)

I have tried to reinstall Oracle JDK 8 and install OpenJDK 8 and vice versa. The issue persists (even though I do really need Oracle JDK in the end)

try {
   SwingUtilities.invokeLater(() -> {
                    try {
                        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                            if ("Nimbus".equals(info.getName())) {
                                UIManager.setLookAndFeel(info.getClassName());
                                break;
                            }
                        }
                    } catch (Exception e) {
                        LogProvider.logError(e.toString());
                        try {                          UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
                        } catch (Exception ex) {
                            LogProvider.logError(ex.toString());
                        }
                    }
                });
            } catch (Exception e) {
                LogProvider.logError(e);
            }
0

There are 0 answers