Skip to main content

[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

The problem could be that you need to start on OS-X with
-XstartOnFirstThread!

Tom

Romuald Quantin schrieb:
> Hi Vinh
> 
> Hmm I'm not sure I understand... First question is, why does it works on
> windows and not mac then?
> 
> Maybe it is not how I should do (sorry I'm both SWT and java beginner)
> but I create a main form in the class entry point like that:
> 
> /public static void main(String[] args) {
>        app = new AppMain();
>    }
>   public AppMain() {
>        mainForm = new MainForm(this);
>        mainForm.init();
> }/
> 
> and then in the MainForm.init(), I do:
> 
> / shell.setLayout(new FillLayout());       shell.setSize (800, 600);
> shell.open();
> displayGlobalSettingsForm();
> while (!shell.isDisposed()) {
>    if (!display.readAndDispatch()) {
>        display.sleep();
>    }
> }
> if(appGlobalSettings.isDirty()) {
>    appGlobalSettings.save();
> }
> display.dispose();    /
> 
> Is that wrong?
> 
> Sorry I dont know what's a UI thread... and I'm not sure what you mean
> by modifying the UI. I see my app and I got my first error when I set a
> path with a browse button, on mac the finder to select the path appears
> and then I see the error in the terminal. While I have none in windows.
> 
> What can I do? and do you have some example somewhere of how I should
> properly do things?
> 
> Thanks again for your help.
> 
> Romu
> 
> Vinh Hoang wrote:
>> 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
>> <mailto: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 <mailto:platform-swt-dev@xxxxxxxxxxx>
>>     https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> platform-swt-dev mailing list
>> platform-swt-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
>>   
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


-- 
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                               leiter softwareentwicklung/CSO
------------------------------------------------------------------------
eduard-bodem-gasse 8/3    A-6020 innsbruck      phone    ++43 512 935834


Back to the top