Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-12-2009, 04:48 PM
Member
 
Join Date: Feb 2009
Posts: 1
Rep Power: 0
Madhavee Latha is on a distinguished road
Default getting following error org.eclipse.swt.SWTException: Invalid thread access
Hello Everyone,
I get the following error on trying to access a different class on click of button

Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access

My code goes like this:

Calling class where main display is coded:

Code:
butt_tenant_dets.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
            TenantDets callTabObj = new TenantDets();
            callTabObj.tenant_table();
			}
		});
Trying to access following code

Code:
public class TenantDets extends ProDomesticMain{
	
	public void tenant_table(){
		
		Table tenantsTable = new Table(work_space,SWT.BORDER);
		tenantsTable.setLinesVisible(true);
				    
}
}

I learnt that following code must be used to solve the problem. But this didnt help me.
Code:
display.syncExec(
  new Runnable() {
    public void run(){
      label.setText(text);
    }
  });
Please help.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 03-24-2009, 01:52 PM
Member
 
Join Date: Mar 2009
Posts: 42
Rep Power: 0
trax is on a distinguished road
Default
You are getting error coz u r trying to set text on a label in a thread process , If u remove problem will be solved , try a alternate solution for setting the text on a label.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error : Invalid path, \bin\javac.exe -classpath Ed JCreator 3 08-14-2009 01:57 PM
org.eclipse.swt.SWTException: Invalid thread access int80 New To Java 2 08-14-2009 11:16 AM
Invalid Thread Access? xcallmejudasx Advanced Java 1 10-30-2008 11:08 PM
Invalid Argument error in IE7 Kaviurs JavaServer Pages (JSP) and JSTL 2 07-01-2008 10:12 AM
Error: invalid method declaration silvia New To Java 1 07-27-2007 01:10 PM


All times are GMT +2. The time now is 11:20 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org