I met a problem when implementing a user interface. Using the constructor JTextArea(Document doc) is the suitable way to solve it. But I don't know how to use interface Document as argument to a constructor. Could anyone tell me how to use it? It will be nice if showing me an example.