Container.java (swapComponents): Add forgotten function, required for JLayeredPane change.

2004-01-06  Graydon Hoare  <graydon@redhat.com>

	* java/awt/Container.java (swapComponents): Add forgotten
	function, required for JLayeredPane change.

From-SVN: r75491
This commit is contained in:
Graydon Hoare 2004-01-07 00:11:51 +00:00 committed by Graydon Hoare
parent 084f5a3539
commit 257dd2808c
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-01-06 Graydon Hoare <graydon@redhat.com>
* java/awt/Container.java (swapComponents): Add forgotten
function, required for JLayeredPane change.
2004-01-06 Michael Koch <konqueror@gmx.de>
* java/text/CollationElementIterator.java: Reformated.

View File

@ -158,6 +158,25 @@ public class Container extends Component
}
}
/**
* Swaps the components at position i and j, in the container.
*/
protected void swapComponents (int i, int j)
{
synchronized (getTreeLock ())
{
if (i < 0
|| i >= component.length
|| j < 0
|| j >= component.length)
throw new ArrayIndexOutOfBoundsException ();
Component tmp = component[i];
component[i] = component[j];
component[j] = tmp;
}
}
/**
* Returns the insets for this container, which is the space used for
* borders, the margin, etc.