home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / 1&1 / java.z / java_301 / sun / awt / windows / WTextComponentPeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-10-20  |  1.2 KB  |  39 lines

  1. package sun.awt.windows;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.TextComponent;
  6. import java.awt.peer.TextComponentPeer;
  7.  
  8. public abstract class WTextComponentPeer extends WComponentPeer implements TextComponentPeer {
  9.    public WTextComponentPeer(Component target) {
  10.       super(target);
  11.    }
  12.  
  13.    public void setEditable(boolean editable) {
  14.       this.widget_setEditable(editable);
  15.       this.setBackground(super.target.getBackground());
  16.    }
  17.  
  18.    public native String getText();
  19.  
  20.    public native void setText(String var1);
  21.  
  22.    public native int getSelectionStart();
  23.  
  24.    public native int getSelectionEnd();
  25.  
  26.    public native void select(int var1, int var2);
  27.  
  28.    public native void widget_setEditable(boolean var1);
  29.  
  30.    public void setBackground(Color c) {
  31.       TextComponent t = (TextComponent)super.target;
  32.       if (t.isEditable()) {
  33.          c = c.brighter();
  34.       }
  35.  
  36.       super.setBackground(c);
  37.    }
  38. }
  39.