[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] SWT JRE 1.5.0 Mac PowerPc

In swt, there's only one UI thread.  Meaning all things modify the UI in some form must go through that one thread.  That thread is usually where you created your display object.  You're getting invalid thread access, it means that you are trying to modify the UI in a non-UI thread.  In order to modify the UI thread, you need to do something like
Display.getDefault().asyncExec(new Runnable(){
  public void run(){
     //modify ui Code
  }
};

I hope that helps. good luck
Vinh

On Thu, Nov 13, 2008 at 10:36 AM, Romuald Quantin <soundstep.mailing@xxxxxxxxxxxxxx> wrote:
Hi everyone,

First post :)

I hope I can find a bit of help. I'm a flash developer (sorry about that), and I'm building an application with SWT.

So, I'm fairly new to java but the job is almost done. I've exported an executable jar and when I tried it on Mac (10.4.1) it didn't work.

I realized I couldn't install the last JRE on a Mac PowerPC... so back to my windows PC, I installed a JRE 1.5.0, created a new workspace in eclipse with JRE 1.5.0, set a new project again with JRE 1.5.0 and export again my executable jar.

When I tried it on the mac, it is getting better as I can see my app! But I've got bugs with it and it is not working at all. I've pasted an example error I got below. As I'm fairly new to java, I dont know what I can do. I believe the SWT jar I use is too advanced for the JRE? Should I find other SWT for mac? and where? Or do I have something wrong in my code?

Well any advice or hunt would be really great...

Thanks a lot.

Romu

Exception in thread "Thread-1072" org.eclipse.swt.SWTException: Invalid thread access
      at org.eclipse.swt.SWT.error(Unknown Source)
      at org.eclipse.swt.SWT.error(Unknown Source)
      at org.eclipse.swt.SWT.error(Unknown Source)
      at org.eclipse.swt.widgets.Display.error(Unknown Source)
      at org.eclipse.swt.widgets.Display.checkDevice(Unknown Source)
      at org.eclipse.swt.widgets.Display.getCursorLocation(Unknown Source)
      at org.eclipse.swt.widgets.Display.mouseHoverProc(Unknown Source)
Exception in thread "Thread-1859" org.eclipse.swt.SWTException: Invalid thread access
      at org.eclipse.swt.SWT.error(Unknown Source)
      at org.eclipse.swt.SWT.error(Unknown Source)
      at org.eclipse.swt.SWT.error(Unknown Source)
      at org.eclipse.swt.widgets.Display.error(Unknown Source)
      at org.eclipse.swt.widgets.Display.checkDevice(Unknown Source)
      at org.eclipse.swt.widgets.Display.getCursorLocation(Unknown Source)
      at org.eclipse.swt.widgets.Display.mouseHoverProc(Unknown Source)


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev