GridLayout.java (setColumns): Check newCols, not cols.

* java/awt/GridLayout.java (setColumns): Check newCols, not cols.
	(setRows): Check newRows, not rows.

From-SVN: r58984
This commit is contained in:
Tom Tromey 2002-11-10 17:35:13 +00:00 committed by Tom Tromey
parent 04e6db94f8
commit 44e8d1f006
2 changed files with 5 additions and 2 deletions

View file

@ -245,7 +245,7 @@ public class GridLayout implements LayoutManager, Serializable
*/
public void setColumns (int newCols)
{
if (cols < 0)
if (newCols < 0)
throw new IllegalArgumentException ("number of columns cannot be negative");
if (newCols == 0 && rows == 0)
throw new IllegalArgumentException ("number of rows is already 0");
@ -271,7 +271,7 @@ public class GridLayout implements LayoutManager, Serializable
*/
public void setRows (int newRows)
{
if (rows < 0)
if (newRows < 0)
throw new IllegalArgumentException ("number of rows cannot be negative");
if (newRows == 0 && cols == 0)
throw new IllegalArgumentException ("number of columns is already 0");