JFormDesigner / FlatLaf

FlatLaf - Swing Look and Feel (with Darcula/IntelliJ themes support)
https://www.formdev.com/flatlaf/
Apache License 2.0
3.4k stars 270 forks source link

UnsatisfiedLinkError in Windows 11 #877

Closed bordaadam closed 2 months ago

bordaadam commented 2 months ago

Hello,

When I try to change the FlatLaf's look and feel, I get the following exception:

[AWT-EventQueue-0] 698 INFO java.lang.UnsatisfiedLinkError: com.formdev.flatlaf.ui.FlatNativeWindowsLibrary.getHWND(Ljava/awt/Window;)J
java.lang.UnsatisfiedLinkError: com.formdev.flatlaf.ui.FlatNativeWindowsLibrary.getHWND(Ljava/awt/Window;)J
    at com.formdev.flatlaf.ui.FlatNativeWindowsLibrary.getHWND(Native Method) ~[flatlaf-3.2.5.jar:3.2.5]
    at com.formdev.flatlaf.ui.FlatPopupFactory.setupWindows11Border(FlatPopupFactory.java:355) ~[flatlaf-3.2.5.jar:3.2.5]
    at com.formdev.flatlaf.ui.FlatPopupFactory.getPopup(FlatPopupFactory.java:105) ~[flatlaf-3.2.5.jar:3.2.5]
    at javax.swing.plaf.PopupMenuUI.getPopup(Unknown Source) ~[?:1.8.0_411]
    at com.formdev.flatlaf.ui.FlatPopupMenuUI.getPopup(FlatPopupMenuUI.java:216) ~[flatlaf-3.2.5.jar:3.2.5]
    at javax.swing.JPopupMenu.showPopup(Unknown Source) ~[?:1.8.0_411]
    at javax.swing.JPopupMenu.setVisible(Unknown Source) ~[?:1.8.0_411]
    at javax.swing.JPopupMenu.show(Unknown Source) ~[?:1.8.0_411]
    at javax.swing.JMenu.setPopupMenuVisible(Unknown Source) ~[?:1.8.0_411]
    at com.jidesoft.swing.JideMenu.setPopupMenuVisibleImmediately(Unknown Source) ~[jide-common-3.7.13.jar:?]
    at com.jidesoft.swing.JideMenu.setPopupMenuVisible(Unknown Source) ~[jide-common-3.7.13.jar:?]
    at javax.swing.JPopupMenu.menuSelectionChanged(Unknown Source) ~[?:1.8.0_411]
    at javax.swing.MenuSelectionManager.setSelectedPath(Unknown Source) ~[?:1.8.0_411]
    at com.jidesoft.plaf.vsnet.VsnetMenuUI.appendPath(Unknown Source) ~[jide-common-3.7.13.jar:?]
    at com.jidesoft.plaf.basic.BasicJideSplitButtonUI.downButtonPressed(Unknown Source) ~[jide-common-3.7.13.jar:?]
    at com.jidesoft.plaf.basic.BasicJideSplitButtonUI$MouseInputHandler.mousePressed(Unknown Source) ~[jide-common-3.7.13.jar:?]
    at java.awt.AWTEventMulticaster.mousePressed(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Component.processMouseEvent(Unknown Source) ~[?:1.8.0_411]
    at javax.swing.JComponent.processMouseEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Component.processEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Container.processEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Component.dispatchEventImpl(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Window.dispatchEventImpl(Unknown Source) ~[?:1.8.0_411]
    at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_411]
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_411]
    at java.awt.EventQueue.access$500(Unknown Source) ~[?:1.8.0_411]
    at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_411]
    at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_411]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_411]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_411]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_411]
    at java.awt.EventQueue$4.run(Unknown Source) ~[?:1.8.0_411]
    at java.awt.EventQueue$4.run(Unknown Source) ~[?:1.8.0_411]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_411]
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_411]
    at java.awt.EventQueue.dispatchEvent(Unknown Source) ~[?:1.8.0_411]

Switching the LookAndFeel to FlatLaf's on Win 10 works as expected... Is it a known issue or am I missing something?

Operating system: Windows 11 Java Version: 1.8.0_411, Oracle Corporation Java Runtime: Java(TM) SE Runtime Environment, 1.8.0_411-b09 Java VM: Java HotSpot(TM) 64-Bit Server VM, 25.411-b09, Oracle Corporation

DevCharly commented 2 months ago

You're using a old flatlaf dll that does not have the method getHWND().

Version of flatlaf dll must match version of flatlaf jar!!!

DevCharly commented 2 months ago

See also: https://www.formdev.com/flatlaf/native-libraries/