on 07-27-2005 11:34 AM
Hi
I am creating a java file , in which i m creating an instance of type Document. But it is givign the error "The type Document cannot be instantiated".
anybody can please help?
Regadrs,
Anupreet
Hi,
check this following link
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/Document.html
Regards,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anupreet,
If you are trying to use <b>Document doc = new Document()</b> then it is not possible cos Document is an interface. Instead use classes AbstractDocument or DefaultStyledDocument in package javax.swing.text or implement Document interface in your class.
use code like this
Document doc.
doc = new AbstractDocument();
or
doc = new DefaultStyledDocument();
----
Hope it helps you.
Regards,
Narinder Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.