View previous topic :: View next topic |
Author |
Message |
mwojc Tux's lil' helper
Joined: 13 Jul 2005 Posts: 79 Location: Poland
|
Posted: Wed Nov 19, 2008 2:18 pm Post subject: printing from java program |
|
|
Hi!
I cannot print from within java applet because of the errors:
Code: | Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: null attribute
at sun.print.IPPPrintService.isAttributeValueSupported(IPPPrintService.java:1147)
at sun.print.ServiceDialog$OrientationPanel.updateInfo(ServiceDialog.java:2121)
at sun.print.ServiceDialog$PageSetupPanel.updateInfo(ServiceDialog.java:1263)
at sun.print.ServiceDialog.updatePanels(ServiceDialog.java:437)
at sun.print.ServiceDialog.initPrintDialog(ServiceDialog.java:195)
at sun.print.ServiceDialog.<init>(ServiceDialog.java:124)
at javax.print.ServiceUI.printDialog(ServiceUI.java:188)
at sun.print.RasterPrinterJob.printDialog(RasterPrinterJob.java:856)
at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:421)
at ht.htView.print(htView.java:434)
at mp2.mp2Frame.onFilePrint(mp2Frame.java:445)
at mp2.mp2Frame$5.actionPerformed(mp2Frame.java:197)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
|
Is there someone who can explain what is going on? Unfortunately i'm not able to interpret properly these messages... I have sun-jdk-1.6.0.07 and cups-1.3.8-r2.
Thanks in advance.
Greetings,
Marek _________________ gentoo@thinkpad |
|
Back to top |
|
|
BlackEye l33t
Joined: 04 Dec 2002 Posts: 756 Location: Germany
|
Posted: Thu Nov 20, 2008 11:39 am Post subject: |
|
|
afaik using local devices through an applet isn't possible due to eccess limitations because of security reasons.
I don't know the way - but what you maybe need to do is to allow the access of local devices. In your case the access to a printer/cups
The NullPointerException itself indicates, that the programmer tried to access a resource (an object) which isn't present at the time of executing. This let me know, that this is an unhandled or unthoughted situation. |
|
Back to top |
|
|
|