Java errors in Matlab 2018b on Windows 10

5 Ansichten (letzte 30 Tage)
Julien
Julien am 12 Feb. 2019
Beantwortet: ZH SU am 29 Jun. 2023
Hi,
I get the following error messages when running certain matlab scripts. In only seems to happen when running specific scripts, however if I use the debugger to try to pinpoint the exact line where it happens, the error is not reproducible: it doesn't always happen at the same line.
The error messages do not stop my scripts, however they make the command window unreadable due to the large number of errors.
Sometimes (usually after running Matlab for a while, or so it seems) I also get the same error message when scrolling down the command window with the mousewheel or using the scroll bar.
This happens on all versions of Matlab I tried (2017a to 2018b, Windows 10 64 bit).
Exception in thread "AWT-EventQueue-0": javax.swing.text.StateInvariantError: Can't render line: 1036
at javax.swing.text.PlainView.drawLine(Unknown Source)
at com.mathworks.mde.cmdwin.CmdWinSyntaxUI$SyntaxPlainView.drawLine(CmdWinSyntaxUI.java:539)
at javax.swing.text.PlainView.paint(Unknown Source)
at com.mathworks.mde.cmdwin.CmdWinSyntaxUI$SyntaxPlainView.paint(CmdWinSyntaxUI.java:325)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager$4.run(Unknown Source)
at javax.swing.RepaintManager$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.access$1200(Unknown Source)
at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(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$JavaSecurityAccessImpl.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)

Antworten (1)

ZH SU
ZH SU am 29 Jun. 2023
I met this question as well, and I can't solve this problem either. But I think the reason is that operation
fprintf('\b')
is so frequent that command window can't refresh correctly. If
pause(0.01)
is added after each fprintf('\b'), it will be ok, but this will slow the program severly. I guess that introducing an output buffer to solw down the frequency may help.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by