Document: dump(PrintStream out) : Document « javax.swing.text « Java by API






Document: dump(PrintStream out)

 

import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.text.AbstractDocument;

public class Main {
  public static void main(String[] args) {
    JFrame f = new JFrame("Text Field Elements");
    JTextField tf = new JTextField(32);
    tf.setText("That's one small step for man...");
    f.getContentPane().add(tf);
    f.pack();
    f.setVisible(true);

    ((AbstractDocument) tf.getDocument()).dump(System.out);
  }
}

   
  








Related examples in the same category

1.Document: addDocumentListener(DocumentListener listener)
2.Document: addUndoableEditListener(UndoableEditListener listener)
3.Document: getDefaultRootElement()
4.Document: getLength()
5.Document: getText(int offset, int length)
6.Document: insertString(int offset, String str, AttributeSet a)
7.Document: remove(int offs, int len)