Results 1 to 2 of 2
  1. #1
    velavan is offline Member
    Join Date
    Jul 2012
    Posts
    1
    Rep Power
    0

    Exclamation Exception ..event dispatching: org.eclipse.swt.SWTException: Invalid thread access

    Hi,

    I was trying to invoke a Swing dialog from another Swing dialog ....with in SWT framework and I am getting the below exception. The code is below


    public void mouseClicked(MouseEvent e) {

    /*if (selectedIndex == 0) {
    index1 = fillList.getSelectedIndex();
    ActionInf selectedAction =
    (ActionInf) fillList.getSelectedValue();

    displayActionDialog(selectedAction, e);
    } else*/
    if (selectedIndex == 0) {
    index2 = fillList1.getSelectedIndex();
    ActionInf selectedAction =
    (ActionInf) fillList1.getSelectedValue();
    //Composite comp = new Composite(composite, SWT.None);
    //Display.getDefault().asyncExec( new Runnable() { public void run() {new SWTActionInitializeDialog().createPartControl(comp osite); } });
    new SWTActionInitializeDialog().createPartControl(comp osite);
    //displayActionDialog(selectedAction, e);
    } /*else if (selectedIndex == 2) {
    index3 = fillList2.getSelectedIndex();
    ActionInf selectedAction =
    (ActionInf) fillList2.getSelectedValue();

    displayActionDialog(selectedAction, e);
    }

    if (selectedIndex == 3) {
    index4 = fillList3.getSelectedIndex();
    ActionInf selectedAction =
    (ActionInf) fillList3.getSelectedValue();

    displayActionDialog(selectedAction, e);
    }*/

    }
    }



    Need help to resolve the below error.



    Exception occurred during event dispatching:
    org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:4083)
    at org.eclipse.swt.SWT.error(SWT.java:3998)
    at org.eclipse.swt.SWT.error(SWT.java:3969)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:4 68)
    at org.eclipse.swt.widgets.Widget.checkWidget(Widget. java:359)
    at org.eclipse.swt.widgets.Widget.checkParent(Widget. java:279)
    at org.eclipse.swt.widgets.Widget.<init>(Widget.java: 149)
    at org.eclipse.swt.widgets.Control.<init>(Control.jav a:108)
    at org.eclipse.swt.widgets.Scrollable.<init>(Scrollab le.java:75)
    at org.eclipse.swt.widgets.Composite.<init>(Composite .java:95)
    at com.bpms.workbench.studio.actions.SWTActionInitial izeDialog.createPartControl(SWTActionInitializeDia log.java:21)
    at com.bpms.workbench.studio.figures.TaskDialog$MyLis tSelectionListener.mouseClicked(TaskDialog.java:31 84)
    at java.awt.AWTEventMulticaster.mouseClicked(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(U nknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn 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.pumpOneEventForFilter s(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.Dialog$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,199
    Rep Power
    19

    Default Re: Exception ..event dispatching: org.eclipse.swt.SWTException: Invalid thread acces

    Moved from AWT/Swing since the question pertains to SWTException.

    I don't use SWT, but you probably shouldn't be mixing toolkits.

    Also, go through these:
    Forum Rules
    Guide For New Members
    BB Code List - Java Programming Forum

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. invalid thread access in eclipse Webnms
    By saifjunaid in forum Web Frameworks
    Replies: 0
    Last Post: 06-13-2011, 12:45 PM
  2. invalid thread access in eclipse
    By saifjunaid in forum Eclipse
    Replies: 0
    Last Post: 06-09-2011, 12:59 PM
  3. Replies: 2
    Last Post: 08-14-2009, 10:16 AM
  4. Replies: 1
    Last Post: 03-24-2009, 12:52 PM
  5. Replies: 2
    Last Post: 07-04-2007, 05:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •