Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic getting Nullpointer exception on diagram clicked. (Read 2728 times)
Mrini
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Aug 18th, 2009
getting Nullpointer exception on diagram clicked.
Feb 12th, 2010 at 11:44am
Print Post  
Hi,

I am getting
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.mindfusion.diagramming.DiagramView.a(Unknown Source)
at com.mindfusion.diagramming.DiagramView.a(Unknown Source)
at com.mindfusion.diagramming.DiagramView.a(Unknown Source)
at com.mindfusion.diagramming.DiagramView$MouseMonitor.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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)


at the first time when I load file into the linktables and clicked on the diagram.
I am using linktables to display my data.
data getting displayed properly.
I tried removing all the listeners from DiagramView still getting same error only at first time .
Don't know from where mouseReleased() event getting fired.
It seems diagramview take some time to initialize events on diagramview. after few seconds it works properly.
is there any solution not to respond any action until the diagramview initialize properly?

thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: getting Nullpointer exception on diagram click
Reply #1 - Feb 12th, 2010 at 12:25pm
Print Post  
Hi,

Are you loading that file from the Swing UI thread? The control is not thread safe, and this usually happens if you load the file from the application's main() function thread while the UI is not yet initialized.

Stoyan
  
Back to top
 
IP Logged
 
Mrini
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Aug 18th, 2009
Re: getting Nullpointer exception on diagram click
Reply #2 - Feb 12th, 2010 at 12:31pm
Print Post  
Yes , you are right.
I am loading that file using SwingWorker thread.
But in such situation what should be the solution because I need to use SwingWorker for process tracking.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: getting Nullpointer exception on diagram click
Reply #3 - Feb 12th, 2010 at 12:38pm
Print Post  
You could load it into a new Diagram instance, and assign the diagram to the view only after the file is fully loaded.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint