Why am i getting this error code when i try to print? I can't tell if this is a matlab error or an error in my pc's coding.

3 次查看(过去 30 天)
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 87
at sun.print.Win32PrintService.getMediaSizes(Unknown Source)
at sun.print.Win32PrintService.initMedia(Unknown Source)
at sun.print.Win32PrintService.isSupportedMedia(Unknown Source)
at sun.print.Win32PrintService.getDefaultAttributeValue(Unknown Source)
at com.mathworks.widgets.text.print.PrintSettings.getLastPrintRequestAttributes(PrintSettings.java:310)
at com.mathworks.mde.cmdwin.XCmdWndView.print(XCmdWndView.java:1350)
at com.mathworks.mde.cmdwin.CmdWinEditorKit$PrintAction.actionPerformed(CmdWinEditorKit.java:1495)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at com.mathworks.mwswing.plaf.MBasicMenuItemUI.doClick(MBasicMenuItemUI.java:1185)
at com.mathworks.mwswing.plaf.MBasicMenuItemUI$MouseInputHandler.mouseReleased(MBasicMenuItemUI.java:1005)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
  3 个评论

请先登录,再进行评论。

回答(1 个)

Shruti Sapre
Shruti Sapre 2015-12-16
Hi Alexander,
The problem likely originates from having a registered printer with an incompatible driver. The incompatibility could be between the printer driver and Java. If a printer driver for an additional registered printer is incorrect, you may not be able to print even if the default printer driver is correct. To work around this issue, you could try the following:
1. Make sure that all registered printers have up-to-date drivers. If this does not solve the problem, it should be possible to unregister the printers individually and determine which one is causing the failure. If you leave that printer unregistered, it should then be possible to print to a different printer.
2. Try deleting and then reinstalling all printers. This process may update all the drivers and solve the issue.
3. If all else fails, an alternate workaround would be to copy and paste into another text editor to print.
Hope this helps!
-Shruti

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by