summaryrefslogtreecommitdiff
path: root/libjava/javax/swing/JFormattedTextField.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/javax/swing/JFormattedTextField.java')
-rw-r--r--libjava/javax/swing/JFormattedTextField.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/libjava/javax/swing/JFormattedTextField.java b/libjava/javax/swing/JFormattedTextField.java
index 8e10a7fc9a6..b84d7cc0de3 100644
--- a/libjava/javax/swing/JFormattedTextField.java
+++ b/libjava/javax/swing/JFormattedTextField.java
@@ -131,6 +131,8 @@ public class JFormattedTextField extends JTextField
public static final int REVERT = 2;
public static final int PERSIST = 3;
+ private Object value;
+
public JFormattedTextField ()
{
throw new InternalError ("not implemented");
@@ -158,7 +160,7 @@ public class JFormattedTextField extends JTextField
public JFormattedTextField (Object value)
{
- throw new InternalError ("not implemented");
+ this.value = value;
}
public void commitEdit ()
@@ -189,12 +191,12 @@ public class JFormattedTextField extends JTextField
public String getUIClassID ()
{
- throw new InternalError ("not implemented");
+ return "FormattedTextFieldUI";
}
public Object getValue ()
{
- throw new InternalError ("not implemented");
+ return value;
}
protected void invalidEdit ()
@@ -212,9 +214,15 @@ public class JFormattedTextField extends JTextField
throw new InternalError ("not implemented");
}
- public void setDocument (Document document)
+ public void setDocument(Document newdoc)
{
- throw new InternalError ("not implemented");
+ Document document = getDocument();
+
+ if (document == newdoc)
+ return;
+
+ setDocument(newdoc);
+ firePropertyChange("document", document, newdoc);
}
public void setLostFocusBehavior (int behavior)
@@ -232,8 +240,8 @@ public class JFormattedTextField extends JTextField
throw new InternalError ("not implemented");
}
- public void setValue (Object value)
+ public void setValue (Object newValue)
{
- throw new InternalError ("not implemented");
+ value = newValue;
}
}