darklaf icon indicating copy to clipboard operation
darklaf copied to clipboard

JTabFrame custom PanelPopup buttons disappear after changing LaF settings

Open loerting opened this issue 2 years ago • 1 comments

PanelPopup bewerbAKo = new PanelPopup(String.format("%s (%s)", name, desc), koIcon, new JScrollPane(SwingUtils.withPadding(koRoundPanel, 16)));
AbstractButton remove = bewerbAKo.addButton(AllIcons.Action.Delete.get(), "Bewerb entfernen");
...
tabFrame.addTab((TabFramePopup) bewerbAKo, name, koIcon, Alignment.SOUTH_WEST);
tabFrame.revalidate();
tabFrame.repaint();

Add a tab like this and change the LaF settings (using the Laf setting menu provided by darklaf) and the added buttons will disappear.

loerting avatar Jun 09 '23 18:06 loerting

java.lang.invoke.WrongMethodTypeException: expected (JComponent,RepaintManager)void but found (JComponent,Void)void
	at java.base/java.lang.invoke.Invokers.newWrongMethodTypeException(Invokers.java:476)
	at java.base/java.lang.invoke.Invokers.checkExactType(Invokers.java:485)
	at org.pbjar.jxlayer.plaf.ext.TransformUI.setView(TransformUI.java:341)
	at org.pbjar.jxlayer.plaf.ext.TransformUI.lambda$new$1(TransformUI.java:179)
	at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:341)
	at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:334)
	at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:266)
	at java.desktop/java.awt.Component.firePropertyChange(Component.java:8731)
	at java.desktop/javax.swing.JLayer.setView(JLayer.java:235)
	at java.desktop/javax.swing.JLayer.remove(JLayer.java:380)
	at java.desktop/java.awt.Container.addImpl(Container.java:1118)
	at java.desktop/javax.swing.JLayer.setView(JLayer.java:232)
	at java.desktop/javax.swing.JLayer.<init>(JLayer.java:201)
	at org.pbjar.jxlayer.plaf.ext.transform.TransformUtils.createTransformJLayer(TransformUtils.java:77)
	at org.pbjar.jxlayer.plaf.ext.transform.TransformUtils.createTransformJLayer(TransformUtils.java:99)
	at com.github.weisj.darklaf.ui.tabframe.DarkTabFrameUI.installComponents(DarkTabFrameUI.java:120)
	at com.github.weisj.darklaf.ui.tabframe.DarkTabFrameUI.installUI(DarkTabFrameUI.java:82)
	at java.desktop/javax.swing.JComponent.setUI(JComponent.java:685)
	at com.github.weisj.darklaf.components.tabframe.JTabFrame.setUI(JTabFrame.java:118)
	at com.github.weisj.darklaf.components.tabframe.JTabFrame.updateUI(JTabFrame.java:87)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1363)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1378)
	at java.desktop/javax.swing.SwingUtilities.updateComponentTreeUI(SwingUtilities.java:1354)
	at com.github.weisj.darklaf.LafInstaller.updateLafRecursively(LafInstaller.java:73)
	at com.github.weisj.darklaf.LafInstaller.updateLaf(LafInstaller.java:65)
	at com.github.weisj.darklaf.LafInstaller.install(LafInstaller.java:53)
	at com.github.weisj.darklaf.LafManager.install(LafManager.java:457)
	at com.github.weisj.darklaf.LafManager.installTheme(LafManager.java:431)
	at com.github.weisj.darklaf.settings.ThemeSettings.lambda$applyTheme$6(ThemeSettings.java:524)
	at com.github.weisj.darklaf.ui.util.UIThread.runOnUIThread(UIThread.java:30)
	at com.github.weisj.darklaf.settings.ThemeSettings.applyTheme(ThemeSettings.java:523)
	at com.github.weisj.darklaf.settings.ThemeSettings.peek(ThemeSettings.java:497)
	at com.github.weisj.darklaf.settings.ThemeSettings.apply(ThemeSettings.java:492)
	at com.github.weisj.darklaf.settings.ThemeSettings.lambda$createButtonPanel$4(ThemeSettings.java:410)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at com.github.weisj.darklaf.ui.button.DarkButtonListener.mouseReleased(DarkButtonListener.java:73)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6400)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)

Could be related to it. Edit: This exception also happens when setting Theme using LafManager.

loerting avatar Jun 09 '23 18:06 loerting