Results 1 to 2 of 2
  1. #1
    royalibrahim is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default Shell() throws SWTException

    Hi,

    The following code throws SWTException: Invalid thread access

    Java Code:
    MessageDialog.openError(new Shell(), "error", "invalid path");
    which is being called inside a WorkspaceJob job thread

    I have tried modifying this code as follows:

    Java Code:
    final Display display = new Display();
    display.syncExec (new Runnable () {
    public void run () {
    MessageDialog.openError(display.getDefault().getActiveShell(), "error", "invalid path");
    }
    });

    but no vain, how to solve this issue?
    Last edited by royalibrahim; 11-09-2009 at 09:41 AM.

  2. #2
    royalibrahim is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default

    ok, I solved the problem by changing WorkspaceJob to WorkbenchJob :)

Similar Threads

  1. Replies: 2
    Last Post: 08-14-2009, 10:16 AM
  2. Execute() throws an NPE
    By mjz in forum JDBC
    Replies: 0
    Last Post: 08-06-2009, 02:25 AM
  3. Replies: 1
    Last Post: 03-24-2009, 12:52 PM
  4. throws
    By jdgallag in forum New To Java
    Replies: 14
    Last Post: 02-11-2009, 01:07 AM
  5. throws Exception
    By javaplus in forum New To Java
    Replies: 1
    Last Post: 11-06-2007, 07:32 PM

Posting Permissions

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