Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Java Exception on Printing?
Date: Wed, 23 Sep 2009 22:21:57 -0400
Organization: The MathWorks
Lines: 53
Message-ID: <h9el45$gbg$1@fred.mathworks.com>
References: <h9ekcf$gf8$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: quistr.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1253758918 16752 172.31.45.136 (24 Sep 2009 02:21:58 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Sep 2009 02:21:58 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
In-Reply-To: <HIDDEN>
Xref: news.mathworks.com comp.soft-sys.matlab:572481


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.