diff options
Diffstat (limited to 'src/java.desktop/share/classes/java/awt/CardLayout.java')
| -rw-r--r-- | src/java.desktop/share/classes/java/awt/CardLayout.java | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/java.desktop/share/classes/java/awt/CardLayout.java b/src/java.desktop/share/classes/java/awt/CardLayout.java index e7523e1921e..fa38057ab0d 100644 --- a/src/java.desktop/share/classes/java/awt/CardLayout.java +++ b/src/java.desktop/share/classes/java/awt/CardLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,15 +25,14 @@ package java.awt; -import java.util.Hashtable; -import java.util.Vector; -import java.util.Enumeration; - -import java.io.Serializable; +import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamField; -import java.io.IOException; +import java.io.Serializable; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; /** * A {@code CardLayout} object is a layout manager for a @@ -68,8 +67,8 @@ public class CardLayout implements LayoutManager2, */ Vector<Card> vector = new Vector<>(); - /* - * A pair of Component and String that represents its name. + /** + * A pair of component and string that represents its name. */ class Card implements Serializable { static final long serialVersionUID = 6640330810709497518L; @@ -110,10 +109,10 @@ public class CardLayout implements LayoutManager2, /** * @serialField tab Hashtable * deprecated, for forward compatibility only - * @serialField hgap int - * @serialField vgap int - * @serialField vector Vector - * @serialField currentCard int + * @serialField hgap int the horizontal Layout gap + * @serialField vgap int the vertical Layout gap + * @serialField vector Vector the pairs of components and their names + * @serialField currentCard int the index of Component currently displayed */ private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("tab", Hashtable.class), @@ -559,6 +558,11 @@ public class CardLayout implements LayoutManager2, /** * Reads serializable fields from stream. + * + * @param s the {@code ObjectInputStream} to read + * @throws ClassNotFoundException if the class of a serialized object could + * not be found + * @throws IOException if an I/O error occurs */ @SuppressWarnings("unchecked") private void readObject(ObjectInputStream s) @@ -591,6 +595,9 @@ public class CardLayout implements LayoutManager2, /** * Writes serializable fields to stream. + * + * @param s the {@code ObjectOutputStream} to write + * @throws IOException if an I/O error occurs */ private void writeObject(ObjectOutputStream s) throws IOException |
