Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5998251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:22:45+00:00 2026-05-23T00:22:45+00:00

I am having an eclipse View. Inside the view I added a Table. Now

  • 0

I am having an eclipse View. Inside the view I added a Table. Now I am calling a thread from run method of the view using asyncExec.

My View class is like –

public class SampleViewAction implements IWorkbenchWindowActionDelegate{

      Thread t;   

      int Count;


      @Override

      public void run(IAction arg0) {

 }
}

Now I added a thread like this –

  PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {                   

                        @Override

                        public void run() {

                              new UDPReadThread();



                        }

                  });

Where UDPReadThread is a class extends a thread where in UDPReadThread ‘s constructor I started the thread.
But I am getting invalid Thread exception.

How to resolve the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:22:46+00:00Added an answer on May 23, 2026 at 12:22 am

    Similar to AWT and the EventDispatchThread, SWT must process everything in the UI thread.

    Your SampleViewAction is run on the UI thread already, in response to a menu or tool item selection.

    It looks like your problem comes from then using an asyncExec(*) which will post the runnable to be run on the UI thread (which delays it), and starting a new thread from that asyncExec Runnable. You may as well simply start your thread, and get rid of that asyncExec.

    Your UDPReadThread is not the UI thread. If you need to update UI widgets from UDPReadThread, that’s the code that needs the asyncExec:

    display.asyncExec(
      new Runnable() {
        public void run(){
          label.setText(text);
        }
    });
    

    Just as an aside, you should not subclass Thread unless you really are extending threads capabilities. The normal pattern when you just want to start another thread:

    UDPReadRunnable udpRunnable = ....;
    Thread thread = new Thread(udpRunnable);
    thread.start();
    

    You can get more information on the display thread from http://www.eclipse.org/swt/faq.php#uithread

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem debugging an Eclipse Application from Eclipse. When I launch the
I'm using Eclipse's AntRunner to build a set of plugins, but I'm having trouble
I'm having the hardest time getting Eclipse to connect and reverse engineer from a
I am using the properties view in RCP, i.e org.eclipse.ui.views.properties.PropertySheet . I want to
I am having trouble getting one of my Android projects under Eclipse to run
I am having an eclipse view which I am trying to display as an
Coming from Eclipse and having been used to duplicate lines all the time, it's
I am having trouble with developing my Android application, I am currently using Eclipse
I'm having a problem with eclipse galileo on ubuntu 64-bit system. when ever i
I am having trouble getting set up with FLTK in Eclipse. I am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.