Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use interface Document as the argument of a constructor?

 
Shen Lin
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You use a reference to an object of a data type that implements the interface.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic