home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- public class CheckboxGroup {
- Checkbox currentChoice;
-
- public Checkbox getCurrent() {
- return this.currentChoice;
- }
-
- public synchronized void setCurrent(Checkbox box) {
- if (box == null || box.group == this) {
- Checkbox oldChoice = this.currentChoice;
- this.currentChoice = box;
- if (oldChoice != null && oldChoice != box) {
- oldChoice.setState(false);
- }
-
- if (box != null && oldChoice != box && !box.getState()) {
- box.setStateInternal(true);
- }
-
- }
- }
-
- public String toString() {
- return this.getClass().getName() + "[current=" + this.currentChoice + "]";
- }
- }
-