miglayout icon indicating copy to clipboard operation
miglayout copied to clipboard

IllegalArgumentException in ver 5.2 (OK in ver 5.1)

Open PerBalling opened this issue 5 years ago • 2 comments

When using MigLayout ver 5.2 in pom.xml for https://sourceforge.net/p/jgpstrackedit/code/ci/master/tree/ class DlgMerge:

import net.miginfocom.swing.MigLayout;

public class DlgMerge extends JDialog { ... contentPanel.setLayout(new MigLayout("", "[][]", "[][][][]")); ... this.pack(); ... }

=>

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width and height must be >= 0 at java.awt.Component.getBaseline(Unknown Source) at javax.swing.JComponent.getBaseline(Unknown Source) at javax.swing.plaf.basic.BasicComboBoxUI.getBaseline(Unknown Source) at javax.swing.JComponent.getBaseline(Unknown Source) at net.miginfocom.swing.SwingComponentWrapper.getBaseline(Unknown Source) at net.miginfocom.layout.Grid$CompWrap.getBaseline(Unknown Source) at net.miginfocom.layout.Grid$CompWrap.access$5000(Unknown Source) at net.miginfocom.layout.Grid.getBaselineAboveBelow(Unknown Source) at net.miginfocom.layout.Grid.access$4500(Unknown Source) at net.miginfocom.layout.Grid$LinkedDimGroup.getMinPrefMax(Unknown Source) at net.miginfocom.layout.Grid$LinkedDimGroup.access$3300(Unknown Source) at net.miginfocom.layout.Grid.getTotalGroupsSizeParallel(Unknown Source) at net.miginfocom.layout.Grid.calcRowsOrColsSizes(Unknown Source) at net.miginfocom.layout.Grid.calcGridSizes(Unknown Source) at net.miginfocom.layout.Grid.checkSizeCalcs(Unknown Source) at net.miginfocom.layout.Grid.layoutImpl(Unknown Source) at net.miginfocom.layout.Grid.layout(Unknown Source) at net.miginfocom.swing.MigLayout.layoutContainer(Unknown Source) at java.awt.Container.layout(Unknown Source) at java.awt.Container.doLayout(Unknown Source) at java.awt.Container.validateTree(Unknown Source) at java.awt.Container.validateTree(Unknown Source) at java.awt.Container.validateTree(Unknown Source) at java.awt.Container.validateTree(Unknown Source) at java.awt.Container.validateTree(Unknown Source) at java.awt.Container.validate(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

PerBalling avatar May 09 '19 18:05 PerBalling

Hm. I'm getting those as well. Thought it was a bug in my layout code somehow.

tbee avatar May 09 '19 18:05 tbee

I have pushed a simple fix that will at least not throw an exception.

mikaelgrev avatar May 21 '19 14:05 mikaelgrev