/[classpath]/classpath/javax/swing/JTextField.java
ViewVC logotype

Diff of /classpath/javax/swing/JTextField.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by mkoch, Wed Feb 16 07:05:33 2005 UTC revision 1.19 by rabbit78, Wed May 11 10:23:05 2005 UTC
# Line 47  import java.beans.PropertyChangeEvent; Line 47  import java.beans.PropertyChangeEvent;
47  import java.beans.PropertyChangeListener;  import java.beans.PropertyChangeListener;
48    
49  import javax.accessibility.AccessibleStateSet;  import javax.accessibility.AccessibleStateSet;
50    import javax.swing.text.AttributeSet;
51    import javax.swing.text.BadLocationException;
52  import javax.swing.text.Document;  import javax.swing.text.Document;
53  import javax.swing.text.JTextComponent;  import javax.swing.text.JTextComponent;
54  import javax.swing.text.PlainDocument;  import javax.swing.text.PlainDocument;
# Line 187  public class JTextField extends JTextCom Line 189  public class JTextField extends JTextCom
189     */     */
190    protected Document createDefaultModel()    protected Document createDefaultModel()
191    {    {
192      return new PlainDocument();      // subclassed to swallow newlines
193        return new PlainDocument() {
194            public void insertString(int offset, String str, AttributeSet a)
195              throws BadLocationException
196            {
197              if (str.indexOf('\n') == -1)
198                super.insertString(offset, str, a);
199            }
200          };
201    }    }
202    
203    /**    /**

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26