 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ramu Guest
|
Posted: Thu Jan 04, 2007 8:11 am Post subject: Applet printing exception |
|
|
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
|
Posted: Thu Jan 04, 2007 8:05 pm Post subject: Re: Applet printing exception |
|
|
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 |
|
 |
|
|
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
|
|