[Mac] SWT Apps and libs that use AWT [message #444152] |
Thu, 07 October 2004 17:30  |
Eclipse User |
|
|
|
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 18:09   |
Eclipse User |
|
|
|
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 #444160 is a reply to message #444154] |
Fri, 08 October 2004 02:16  |
Eclipse User |
|
|
|
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)
|
|
|
Powered by
FUDForum. Page generated in 0.03820 seconds