aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/Container.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/awt/Container.java')
-rw-r--r--libjava/java/awt/Container.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
index e96b13d..ad43ce4 100644
--- a/libjava/java/awt/Container.java
+++ b/libjava/java/awt/Container.java
@@ -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.
*