AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Applet printing exception

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java
View previous topic :: View next topic  
Author Message
Ramu
Guest





PostPosted: Thu Jan 04, 2007 8:11 am    Post subject: Applet printing exception Reply with quote



Hi All,
1) I want to print my html page from applet.If i run my applet
from browser then my applet should be sigened but i am running my
applet from appletviewer then also i am getting exception

Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at PrinterApplet.prep(PrinterApplet.java:80)
at PrinterApplet.print(PrinterApplet.java:102)
at PrinterApplet$1.actionPerformed(PrinterApplet.java:55)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
49)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
a:2169)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
..java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
)

and i think my applet need not be signed for the page from which it is
loaded.

2) how can i send my html content to the applet for
printing.anybody suggest me any examples or suggestions in this issue.
thanks in advance.
Back to top
Tom Hawtin
Guest





PostPosted: Thu Jan 04, 2007 8:05 pm    Post subject: Re: Applet printing exception Reply with quote



Ramu wrote:
Quote:
1) I want to print my html page from applet.If i run my applet
from browser then my applet should be sigened but i am running my
applet from appletviewer then also i am getting exception

Certainly from the Plug-In, if you try to print from an unsigned applet,
you should get a dialog asking to proceed. If you are signing a jar
file, you really should know what you are getting in to.

Quote:
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at PrinterApplet.prep(PrinterApplet.java:80)
at PrinterApplet.print(PrinterApplet.java:102)
at PrinterApplet$1.actionPerformed(PrinterApplet.java:55)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
49)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
a:2169)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
)

That looks like a bug in your program. Your code is attempting to
dereference a null pointer.

Quote:
2) how can i send my html content to the applet for
printing.anybody suggest me any examples or suggestions in this issue.
thanks in advance.

Using java.net.URL would be the obvious solution.

Tom Hawtin
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.