2001-05-03 Mo DeJong <mdejong@redhat.com>
[official-gcc.git] / libjava / java / awt / CheckboxGroup.java
blobd098a420999a90d27e7f86bf1ec8a5c52d840c7a
1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
7 details. */
9 package java.awt;
11 import java.io.Serializable;
13 /** This class is used to groups checkbox components.
14 * @author Tom Tromey <tromey@redhat.com>
15 * @date December 25, 2000
17 public class CheckboxGroup implements Serializable
19 // Current set checkbox.
20 Checkbox selectedCheckbox;
22 /** Create a new instance of CheckboxGroup. */
23 public CheckboxGroup ()
27 /** Returns the currently selected checkbox in the group.
28 * @deprecated
30 public Checkbox getCurrent ()
32 return getSelectedCheckbox ();
35 /** Returns the currently selected checkbox in the group. */
36 public Checkbox getSelectedCheckbox ()
38 return selectedCheckbox;
41 /** Set the selected checkbox.
42 * @deprecated
44 public synchronized void setCurrent (Checkbox checkbox)
46 setSelectedCheckbox (checkbox);
49 /** Set the selected checkbox. */
50 public synchronized void setSelectedCheckbox (Checkbox checkbox)
52 if (checkbox != null && checkbox.group != this)
53 return;
55 selectedCheckbox.setState (false);
56 selectedCheckbox = checkbox;
57 if (checkbox != null)
58 checkbox.setState (true);
61 /** Return String representation of this class and current Checkbox. */
62 public String toString ()
64 return "[CheckboxGroup: " + selectedCheckbox + "]";