Skip to content

JideTabbedPane issue with LookAndFeelFactory in Linux #37

@mokun

Description

@mokun

I have WebLaF installed.

I called the following

LookAndFeelFactory.installJideExtension(LookAndFeelFactory.VSNET_STYLE);

right before I setup the JideTabbedPane as follows :

JideTabbedPane tabPanel = new JideTabbedPane();

In windows, it works well.

Somehow it doesn't work well in linux and keeps throwing ClassNotFoundException in my app.

It can be traced to this line in LookAndFeelFactory class calling the method

else if (isWindowsLookAndFeel(lnf)) { ...

    /**
     * As of Java 10, com.sun.java.swing.plaf.windows.WindowsLookAndFeel is no longer available on macOS thus
     * "instanceof WindowsLookAndFeel" directives will result in a NoClassDefFoundError during runtime. This method
     * was introduced to avoid this exception.
     *
     * @param lnf
     * @return true if it is a WindowsLookAndFeel.
     */
    public static boolean isWindowsLookAndFeel(LookAndFeel lnf) {
        if (lnf == null) {
            return false;
        }
        else {
            try {
                Class c = Class.forName(WINDOWS_LNF);
                return c.isInstance(lnf);
            }
            catch (ClassNotFoundException | NoClassDefFoundError ignore) {
                // if it is not possible to load the Windows LnF class, the
                // given lnf instance cannot be an instance of the Windows
                // LnF class
                return false;
            }
        }
    }

Please help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions