1 30 31 32 package org.hsqldb.util; 33 34 import java.awt.Color ; 35 import java.awt.TextField ; 36 37 44 45 public class ZaurusTextField extends TextField implements ZaurusComponent { 48 49 int countChanges; 50 51 public ZaurusTextField(int i) { 52 53 super(i); 54 55 countChanges = 0; 56 } 57 58 public void clearChanges() { 59 countChanges = 0; 60 } 61 62 public void clearContent() { 63 super.setText(""); 64 } 65 66 public String getContent() { 67 return super.getText(); 68 } 69 70 public boolean hasChanged() { 72 return countChanges > 1; 73 } 74 75 public void requestFocus() { 76 super.requestFocus(); 77 } 78 79 public void setChanged() { 80 countChanges++; 81 } 82 83 public void setContent(String s) { 84 super.setText(s); 85 } 86 87 public void setEditable(boolean b) { 88 89 super.setEditable(b); 90 91 if (b) { 92 super.setBackground(Color.white); 93 } else { 94 super.setBackground(Color.lightGray); 95 } } 97 } 98 | Popular Tags |