home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / awt / FocusingTextField.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  862 b   |  55 lines

  1. package sun.awt;
  2.  
  3. import java.awt.Event;
  4. import java.awt.TextField;
  5.  
  6. public class FocusingTextField extends TextField {
  7.    TextField next;
  8.    boolean willSelect;
  9.  
  10.    public FocusingTextField(int var1) {
  11.       super("", var1);
  12.    }
  13.  
  14.    public FocusingTextField(int var1, boolean var2) {
  15.       this(var1);
  16.       this.willSelect = var2;
  17.    }
  18.  
  19.    public void setWillSelect(boolean var1) {
  20.       this.willSelect = var1;
  21.    }
  22.  
  23.    public boolean getWillSelect() {
  24.       return this.willSelect;
  25.    }
  26.  
  27.    public void setNextField(TextField var1) {
  28.       this.next = var1;
  29.    }
  30.  
  31.    public boolean gotFocus(Event var1, Object var2) {
  32.       if (this.willSelect) {
  33.          this.select(0, this.getText().length());
  34.       }
  35.  
  36.       return true;
  37.    }
  38.  
  39.    public boolean lostFocus(Event var1, Object var2) {
  40.       if (this.willSelect) {
  41.          this.select(0, 0);
  42.       }
  43.  
  44.       return true;
  45.    }
  46.  
  47.    public void nextFocus() {
  48.       if (this.next != null) {
  49.          this.next.requestFocus();
  50.       }
  51.  
  52.       super.nextFocus();
  53.    }
  54. }
  55.