Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / January 2007

Tip: Looking for answers? Try searching our database.

Applet printing exception

Thread view: 
Ramu - 04 Jan 2007 05:58 GMT
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.
Tom Hawtin - 04 Jan 2007 14:05 GMT
> 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.

> Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
>         at PrinterApplet.prep(PrinterApplet.java:80)
[quoted text clipped - 12 lines]
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
> )

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

> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.