You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was facing the non transparent shadows issue (#79) for menus.
Trying to remove both shade and rounded corners causes some dimensions to become negative.
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:340)
at com.alee.utils.NinePatchUtils.createShadeIcon(NinePatchUtils.java:86)
at com.alee.utils.NinePatchUtils.getShadeIcon(NinePatchUtils.java:65)
at com.alee.laf.menu.WebPopupPainter.paintShade(WebPopupPainter.java:478)
at com.alee.laf.menu.PopupMenuPainter.paintTransparentPopup(PopupMenuPainter.java:53)
at com.alee.laf.menu.PopupMenuPainter.paintTransparentPopup(PopupMenuPainter.java:30)
at com.alee.laf.menu.WebPopupPainter.paint(WebPopupPainter.java:421)
at com.alee.laf.menu.WebPopupMenuUI.paint(WebPopupMenuUI.java:740)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5219)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1529)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1452)
at javax.swing.RepaintManager.paint(RepaintManager.java:1249)
at javax.swing.JComponent._paintImmediately(JComponent.java:5167)
at javax.swing.JComponent.paintImmediately(JComponent.java:4978)
at javax.swing.RepaintManager$3.run(RepaintManager.java:808)
at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:769)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:718)
at javax.swing.RepaintManager.access$1100(RepaintManager.java:62)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1677)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
My code
// initialize menu, works wellWebMenuBarmenuBar = newWebMenuBar ();
setupMenuBar ( menuBar );
WebMenufileMenu = (WebMenu) menuBar.getMenu(0);
WebPopupMenuUIpopupMenu = (WebPopupMenuUI) fileMenu.getPopupMenu().getUI();
// set round and shade, causes error when both options are set to zeropopupMenu.setRound(0);
popupMenu.setShadeWidth(0);
And, though I don't think the error has something to do with it, the setup code for the menu.
Thanks for reporting and especially for the simple example that represents this issue!
There was indeed a small bug with shade paint method.
Fix will be available in v1.27 version.
I have also made a lot of changes to menu code and corner will now display properly even when shadeWidth is less than cornerWidth (that was also an issue in old version).
#86 - WebFileDrop settings and selected files fix#85 - WebRootPaneUI maximize is now disabled on title double-click when maximize button is hidden
Major improvements in StyleManager and skin installation behavior
Default style painters are now also custom and moved into separate skin package
Redundant PainterMethods interface and its implementations removed
From now on all specific style settings will be contained inside painters only
PanelPainter support added, WebPanel and WebPanelUI classes upgraded
NinePatchIcon painting within custom bounds fixed
WebScrollBarUI preferred size fix
I was facing the non transparent shadows issue (#79) for menus.
Trying to remove both shade and rounded corners causes some dimensions to become negative.
My code
And, though I don't think the error has something to do with it, the setup code for the menu.
The text was updated successfully, but these errors were encountered: