summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorTania Bento <tbento@redhat.com>2006-08-01 16:10:19 +0000
committerTania Bento <tbento@redhat.com>2006-08-01 16:10:19 +0000
commit605c294d9e0c2e1b0d1ea217575fe9e42f6935f3 (patch)
treef5f38340d46aa72086030ed51c07d040873c3905 /java
parent48f87100cc39db5302172c43838cb99968a6cd6f (diff)
downloadclasspath-605c294d9e0c2e1b0d1ea217575fe9e42f6935f3.tar.gz
2006-08-01 Tania Bento <tbento@redhat.com>
* java/awt/CardLayout.java (toString): Changed format of string outputted. (goToComponent): Changed the order of the if-clause.
Diffstat (limited to 'java')
-rw-r--r--java/awt/CardLayout.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/java/awt/CardLayout.java b/java/awt/CardLayout.java
index fcb05215a..7b733c821 100644
--- a/java/awt/CardLayout.java
+++ b/java/awt/CardLayout.java
@@ -361,7 +361,7 @@ public class CardLayout implements LayoutManager2, Serializable
*/
public String toString ()
{
- return getClass ().getName () + "[" + hgap + "," + vgap + "]";
+ return getClass ().getName () + "[hgap=" + hgap + ",vgap=" + vgap + "]";
}
/**
@@ -401,11 +401,11 @@ public class CardLayout implements LayoutManager2, Serializable
{
if (comps[i].isVisible ())
{
- if (what == NEXT)
+ if (choice == i)
{
- choice = i + 1;
- if (choice == num)
- choice = 0;
+ // Do nothing if we're already looking at the right
+ // component.
+ return;
}
else if (what == PREV)
{
@@ -413,11 +413,11 @@ public class CardLayout implements LayoutManager2, Serializable
if (choice < 0)
choice = num - 1;
}
- else if (choice == i)
+ else if (what == NEXT)
{
- // Do nothing if we're already looking at the right
- // component.
- return;
+ choice = i + 1;
+ if (choice == num)
+ choice = 0;
}
comps[i].setVisible (false);