Thread Subject: Java Exception on Printing?

Subject: Java Exception on Printing?

From: Rebecca

Date: 24 Sep, 2009 02:09:19

Message: 1 of 6

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)

Subject: Java Exception on Printing?

From: Richard Quist

Date: 24 Sep, 2009 02:21:57

Message: 2 of 6

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.

Subject: Java Exception on Printing?

From: Mehmet

Date: 4 Oct, 2009 15:36:01

Message: 3 of 6

Richard Quist <rquist_nospam@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.

Subject: Java Exception on Printing?

From: Rebecca

Date: 8 Oct, 2009 19:52:02

Message: 4 of 6

Richard Quist <rquist_nospam@mathworks.com> wrote in message <h9el45$gbg$1@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

Subject: Java Exception on Printing?

From: Richard Quist

Date: 9 Oct, 2009 11:48:49

Message: 5 of 6

Rebecca wrote:
> Richard Quist <rquist_nospam@mathworks.com> wrote in message <h9el45$gbg$1@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.

Subject: Java Exception on Printing?

From: Eric

Date: 19 Oct, 2009 20:57:01

Message: 6 of 6

"Rebecca " <rbemros@siue.edu> wrote in message <h9ekcf$gf8$1@fred.mathworks.com>...
> 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
>

I have the same configuration and problem. It's not a fix, but if you need to get the stuff printed, you can use the Publish feature to get printable HTML or PDF output.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
java Rebecca 8 Oct, 2009 15:54:09
mac Rebecca 8 Oct, 2009 15:54:09
snow leopard Rebecca 8 Oct, 2009 15:54:09
java exception Rebecca 23 Sep, 2009 22:09:21
print Rebecca 23 Sep, 2009 22:09:21
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com