From: Rebecca on
I'm trying to print out my code, and pressing the print button in the Editor or choosing File/Print seems to cause a Java exception to be thrown. How do I fix this so I can print from MatLab?

I'm running 2009a Student Version on Mac OS X 10.6.1

This is the specific error message that is displayed in the cmd window:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.mathworks.widgets.text.print.PrintSettings.getLastPrintRequestAttributes(PrintSettings.java:280)
at com.mathworks.widgets.SyntaxTextPaneBase.printDocument(SyntaxTextPaneBase.java:2031)
at com.mathworks.widgets.SyntaxTextPaneMultiView.printDocument(SyntaxTextPaneMultiView.java:750)
at com.mathworks.mde.editor.EditorView.doPrint(EditorView.java:1284)
at com.mathworks.mde.editor.EditorView.access$2300(EditorView.java:92)
at com.mathworks.mde.editor.EditorView$8.update(EditorView.java:775)
at com.mathworks.mde.editor.EditorAction$ObservableAction.actionPerformed(EditorAction.java:52)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6348)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:294)
at java.awt.Component.processEvent(Component.java:6113)
at java.awt.Container.processEvent(Container.java:2085)
at java.awt.Component.dispatchEventImpl(Component.java:4714)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
at java.awt.Container.dispatchEventImpl(Container.java:2129)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
From: Richard Quist on
Rebecca wrote:
> I'm trying to print out my code, and pressing the print button in the Editor or choosing File/Print seems to cause a Java exception to be thrown. How do I fix this so I can print from MatLab?
>
> I'm running 2009a Student Version on Mac OS X 10.6.1
>
> This is the specific error message that is displayed in the cmd window:
>
> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
> at com.mathworks.widgets.text.print.PrintSettings.getLastPrintRequestAttributes(PrintSettings.java:280)
> at com.mathworks.widgets.SyntaxTextPaneBase.printDocument(SyntaxTextPaneBase.java:2031)
> at com.mathworks.widgets.SyntaxTextPaneMultiView.printDocument(SyntaxTextPaneMultiView.java:750)
> at com.mathworks.mde.editor.EditorView.doPrint(EditorView.java:1284)
> at com.mathworks.mde.editor.EditorView.access$2300(EditorView.java:92)
> at com.mathworks.mde.editor.EditorView$8.update(EditorView.java:775)
> at com.mathworks.mde.editor.EditorAction$ObservableAction.actionPerformed(EditorAction.java:52)
> at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
> at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
> at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
> at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
> at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
> at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
> at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
> at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
> at java.awt.Component.processMouseEvent(Component.java:6348)
> at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
> at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:294)
> at java.awt.Component.processEvent(Component.java:6113)
> at java.awt.Container.processEvent(Container.java:2085)
> at java.awt.Component.dispatchEventImpl(Component.java:4714)
> at java.awt.Container.dispatchEventImpl(Container.java:2143)
> at java.awt.Component.dispatchEvent(Component.java:4544)
> at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
> at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
> at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
> at java.awt.Container.dispatchEventImpl(Container.java:2129)
> at java.awt.Window.dispatchEventImpl(Window.java:2475)
> at java.awt.Component.dispatchEvent(Component.java:4544)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
That sounds like this issue: http://www.mathworks.com/support/bugreports/337376

There's a possible workaround mentioned near the bottom of that page

--

Richard Quist
Software Developer
The MathWorks, Inc.
From: Mehmet on
Richard Quist <rquist_nospam(a)mathworks.com> wrote in message

> That sounds like this issue: http://www.mathworks.com/support/bugreports/337376
>
> There's a possible workaround mentioned near the bottom of that page

I don't think it's the same issue. I don't have any network printers, and I get the same message as Rebecca, not the one mentioned in the bug report. I also have the same version as Rebecca, and also on snow leopard.
From: Rebecca on
Richard Quist <rquist_nospam(a)mathworks.com> wrote in message <h9el45$gbg$1(a)fred.mathworks.com>...
> Rebecca wrote:
<....>
> That sounds like this issue: http://www.mathworks.com/support/bugreports/337376
>
> There's a possible workaround mentioned near the bottom of that page
>
> --
>
> Richard Quist
> Software Developer
> The MathWorks, Inc.

Thanks Richard, but I don't think that's it. I'm trying to print to a printer plugged into my computer via USB. It's not a network printer at all.

I've also tried the various other suggestions for dealing with (what seem to me to be) random Java exceptions - I changed the Java preferences to favour the 32-bit Java VM. I'm at a loss of what to do next though.

-R
From: Richard Quist on
Rebecca wrote:
> Richard Quist <rquist_nospam(a)mathworks.com> wrote in message <h9el45$gbg$1(a)fred.mathworks.com>...
>> Rebecca wrote:
> <....>
>> That sounds like this issue: http://www.mathworks.com/support/bugreports/337376
>>
>> There's a possible workaround mentioned near the bottom of that page
>>
>> --
>>
>> Richard Quist
>> Software Developer
>> The MathWorks, Inc.
>
> Thanks Richard, but I don't think that's it. I'm trying to print to a printer plugged into my computer via USB. It's not a network printer at all.
>
> I've also tried the various other suggestions for dealing with (what seem to me to be) random Java exceptions - I changed the Java preferences to favour the 32-bit Java VM. I'm at a loss of what to do next though.
>
> -R
I suggest you contact Customer Support. Sometimes the version of Java in use
and the version of CUPS (Common Unix Printing Service) that supports printing
on OS X. They may be able to help identify what's going on.

--

Richard Quist
Software Developer
The MathWorks, Inc.