Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!