Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Fwd: [Bug 67384] SWT_AWT not implemented for Mac

Someone posted a bug reference for the SWT_AWT deal. Below is a comment from that bug track that seems like it may help us out.

------- Additional Comment #6 From Andre Weinand 2003-09-25 05:20 -------

<x-tad-bigger>Another tidbit for using SWT and AWT in the same application (I've posted this on 9/18 on the
news group eclipse.platform.swt):

The problem with using AWT in a SWT application is, that whenever you use any AWT class
the Mac OS X implementation of AWT goes through an initialization sequence that sets up the
menu bar and adds an icon to the Dock. The assumption here is that whenever you use AWT your
application automatically becomes an UI application. On the Mac a consequence of this is that your
application starts an event loop. However, if you are an SWT application, another event loop is
already running. This results in a deadlock.

The good news: I found a workaround:

In Java 1.4.1 AWT supports a so called "headless" mode, in which it does not initialize the UI (and
does not create the event loop). In this mode you'll get java.awt.HeadlessExceptions if you try to
create UI elements like Buttons etc. However, working with BufferedImages does not require a UI
and works fine.

You'll just have to pass a "-Djava.awt.headless=true" command line argument to your application
or call the following just before loading AWT:

System.setProperty("java.awt.headless", "true");

and your code no longer deadlocks.
</x-tad-bigger>


Begin forwarded message:

From: bugzilla-daemon@xxxxxxxxxxx
Date: August 11, 2004 11:34:27 EDT
To: mrevelle@xxxxxxxxxxxxxxxxxx
Subject: [Bug 67384] SWT_AWT not implemented for Mac

https://bugs.eclipse.org/bugs/show_bug.cgi?id=67384





------- Additional Comments From Silenio_Quarti@xxxxxxxxxx 2004-08-11 11:34 -------
When you are running inside Eclipse, you are not using the "java" executable.
You are using the "java_swt" executable, which is a modified version of the
exec that changes the carbon UI thread. This is probably why you are
experiencing the hang. See bug#40003 for a more complete explanation.



------- You are receiving this mail because: -------
You are a voter for the bug, or are watching someone who is.

Matt Revelle
Software Engineer
Integrity Applications Incorporated
703 378 8672 x171

Back to the top