Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [Mac] SWT Apps and libs that use AWT
[Mac] SWT Apps and libs that use AWT [message #444152] Thu, 07 October 2004 21:30 Go to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Hi,

in my SWT Application I am using iText to generate PDF documents. iText is
using AWT to get things done. Now, when launching my application from
within Eclipse on Mac, everything works fine until it comes to generation
of PDF. Then, an Exception is thrown that AWT is not working properly in
the current configuration. I've put -XStartOnFirstThread as JVM Argument
which seems to be the cause why AWT is not working.

I've never used the swt_awt bridge, but does it maybe have to do something
about it? Looking at the API it seems to only allow to use a JFrame or
Shell using AWT, but not other libs using AWT (like iText is using
java.awt.Color).

Thanks for help,
Ben
Re: [Mac] SWT Apps and libs that use AWT [message #444153 is a reply to message #444152] Thu, 07 October 2004 22:09 Go to previous messageGo to next message
Andre Weinand is currently offline Andre WeinandFriend
Messages: 66
Registered: July 2009
Member
On 7.10.2004 23:30 Uhr, in article ck4ch8$eh4$1@eclipse.org, "Benjamin
Pasero" <bpasero@rssowl.org> wrote:

> Hi,
>
> in my SWT Application I am using iText to generate PDF documents. iText is
> using AWT to get things done. Now, when launching my application from
> within Eclipse on Mac, everything works fine until it comes to generation
> of PDF. Then, an Exception is thrown that AWT is not working properly in
> the current configuration. I've put -XStartOnFirstThread as JVM Argument
> which seems to be the cause why AWT is not working.
>
> I've never used the swt_awt bridge, but does it maybe have to do something
> about it? Looking at the API it seems to only allow to use a JFrame or
> Shell using AWT, but not other libs using AWT (like iText is using
> java.awt.Color).

In general, you cannot mix AWT and SWT on MacOS X.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=67384 for details

However, if you use AWT non-interactively, it might be possible to run AWT
from an SWT application in "headless" mode. You'll need to set the
corresponding property before AWT gets initialized (and its event loop
starts).

--andre
Re: [Mac] SWT Apps and libs that use AWT [message #444154 is a reply to message #444152] Thu, 07 October 2004 22:11 Go to previous messageGo to next message
Brion Vibber is currently offline Brion VibberFriend
Messages: 21
Registered: July 2009
Junior Member
Benjamin Pasero wrote:
> in my SWT Application I am using iText to generate PDF documents. iText is
> using AWT to get things done. Now, when launching my application from
> within Eclipse on Mac, everything works fine until it comes to generation
> of PDF. Then, an Exception is thrown that AWT is not working properly in
> the current configuration. I've put -XStartOnFirstThread as JVM Argument
> which seems to be the cause why AWT is not working.

Last I heard SWT and AWT are not compatible on the Mac due to the
threading & event loop conflicts. You might try using
-Djava.awt.headless=true and see if that'll get the graphics functions
working without initializing the AWT GUI.

-- brion vibber (brion @ pobox.com)
Re: [Mac] SWT Apps and libs that use AWT [message #444160 is a reply to message #444154] Fri, 08 October 2004 06:16 Go to previous message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Thanks for this usefull information. I will try that DWord next time I am
working on Mac again.

Ben

> Benjamin Pasero wrote:
> > in my SWT Application I am using iText to generate PDF documents. iText is
> > using AWT to get things done. Now, when launching my application from
> > within Eclipse on Mac, everything works fine until it comes to generation
> > of PDF. Then, an Exception is thrown that AWT is not working properly in
> > the current configuration. I've put -XStartOnFirstThread as JVM Argument
> > which seems to be the cause why AWT is not working.

> Last I heard SWT and AWT are not compatible on the Mac due to the
> threading & event loop conflicts. You might try using
> -Djava.awt.headless=true and see if that'll get the graphics functions
> working without initializing the AWT GUI.

> -- brion vibber (brion @ pobox.com)
Previous Topic:SWT Carbon internal event handling
Next Topic:How do I get disk space, free %, etc. plz
Goto Forum:
  


Current Time: Fri Apr 19 00:10:16 GMT 2024

Powered by FUDForum. Page generated in 0.01917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top