GridLayout.java (layoutContainer): Handle case where there are no items in container.
* java/awt/GridLayout.java (layoutContainer): Handle case where there are no items in container. From-SVN: r50539
This commit is contained in:
@@ -152,6 +152,12 @@ public class GridLayout implements LayoutManager, Serializable
|
||||
public void layoutContainer (Container parent)
|
||||
{
|
||||
int num = parent.ncomponents;
|
||||
|
||||
// There's no point, and handling this would mean adding special
|
||||
// cases.
|
||||
if (num == 0)
|
||||
return;
|
||||
|
||||
// This is more efficient than calling getComponents().
|
||||
Component[] comps = parent.component;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user