aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@redhat.com>2004-01-07 00:11:51 +0000
committerGraydon Hoare <graydon@gcc.gnu.org>2004-01-07 00:11:51 +0000
commit257dd2808cee44f3be78edad3549c6fba56e2b35 (patch)
tree01d3ab4d0e125c801df6443fa9ea830bd2fb0b1a
parent084f5a35392f1ce138a3b9065b92346cc8383490 (diff)
downloadgcc-257dd2808cee44f3be78edad3549c6fba56e2b35.zip
gcc-257dd2808cee44f3be78edad3549c6fba56e2b35.tar.gz
gcc-257dd2808cee44f3be78edad3549c6fba56e2b35.tar.bz2
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
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/java/awt/Container.java19
2 files changed, 24 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 3750a46..02562e5 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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.
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.
*