Thread Subject: Java errors during menu callback in GUI

Subject: Java errors during menu callback in GUI

From: Andy

Date: 6 Aug, 2009 18:25:19

Message: 1 of 2

I have written a help section for my GUI program in HTML, and I'm trying to call it with the following callback:

function helpmenu_Callback(src,eventdata)
    web('myhelp.html','-notoolbar','-noaddressbox','-new');
end

Here's the relevant code creating the help menu:

help=uimenu('Parent',f,...
    'Label','Help');
helpMenu=uimenu('Parent',help,...
    'Label','Help',...
    'Accelerator','H',...
    'Callback',{@helpmenu_Callback});

When I call the help, either by clicking it or by using Ctrl+'H', the help window shows up every time, but most of the time I get the following error:

[ConditionalEventPump] Exception occurred during event dispatching:
java.lang.NullPointerException
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)

Wrapping the web call in a try catch block doesn't catch this error. I can't tell if this error matters or not. (Like I said, it's not preventing the help window from showing properly.) Also, using the syntax stat=web(...) returns 0.

Does anybody know what's going on?

Thanks.

Subject: Java errors during menu callback in GUI

From: Andy

Date: 6 Aug, 2009 19:37:01

Message: 2 of 2

"Andy " <theorigamist@gmail.com> wrote in message <h5f76f$obj$1@fred.mathworks.com>...
> I have written a help section for my GUI program in HTML, and I'm trying to call it with the following callback:
>
> function helpmenu_Callback(src,eventdata)
> web('myhelp.html','-notoolbar','-noaddressbox','-new');
> end
>
> Here's the relevant code creating the help menu:
>
> help=uimenu('Parent',f,...
> 'Label','Help');
> helpMenu=uimenu('Parent',help,...
> 'Label','Help',...
> 'Accelerator','H',...
> 'Callback',{@helpmenu_Callback});
>
> When I call the help, either by clicking it or by using Ctrl+'H', the help window shows up every time, but most of the time I get the following error:
>
> [ConditionalEventPump] Exception occurred during event dispatching:
> java.lang.NullPointerException
> at javax.swing.JComponent._paintImmediately(Unknown Source)
> at javax.swing.JComponent.paintImmediately(Unknown Source)
> at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
> at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
> at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
> at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
> at java.awt.event.InvocationEvent.dispatch(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)
>
> Wrapping the web call in a try catch block doesn't catch this error. I can't tell if this error matters or not. (Like I said, it's not preventing the help window from showing properly.) Also, using the syntax stat=web(...) returns 0.
>
> Does anybody know what's going on?
>
> Thanks.

Update: the code

web('myhelp.html','-browser');

has not yet thrown an error. So it would seem this is coming from the MATLAB browser, and not my program.

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
web Andy 6 Aug, 2009 15:31:26
java Andy 6 Aug, 2009 15:31:26
rssFeed for this Thread

Contact us at files@mathworks.com