-
Notifications
You must be signed in to change notification settings - Fork 234
Description
Description
I am using the default WebLightSkin and WebDarkSkin in my app. And i have a button to switch between these two skins at runtime using StyleManager.setSkin() method. Everything works as expected whenever i click the switch skin button. However, i also have a JPopupMenu in my JFrame form i.e. when i right click, it displays some popup menu. Now here is the problem.
If i start the app with either light or dark skin WebLookAndFeel.install(WebDarkSkin.class); everything works fine and whenever i right-click, i see the popup menu. But immediately i press the switch skin button to switch from light to dark or from dark to light skin, after the skin changes, my popup menu will not show again, no matter what i click, it will not show up again.
Code example
static Skin dark;
static Skin light;
public static void main(String[] args){
//install webLaf
WebLookAndFeel.install(WebDarkSkin.class);
//initialize the skins
light = new WebLightSkin();
dark = new WebDarkSkin();
}
public void switchSkinButton(){
EventQueue.invokeLater(() -> {
StyleManager.setSkin(chkDarkMode.isSelected() ? dark : light);
});
}
Additional information
- OS Windows 10
- Java runtime version: JDK 1.8 update 262
- WebLaF version: v1.2.13