2004-01-06 Graydon Hoare <graydon@redhat.com>
authorgraydon <graydon@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jan 2004 00:11:51 +0000 (00:11 +0000)
committergraydon <graydon@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Jan 2004 00:11:51 +0000 (00:11 +0000)
* java/awt/Container.java (swapComponents): Add forgotten
function, required for JLayeredPane change.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75491 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/awt/Container.java

index 3750a46..02562e5 100644 (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.
index e96b13d..ad43ce4 100644 (file)
@@ -159,6 +159,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.
    *