No Display.getCurrent() when opening Swing Component [message #446929] |
Mon, 06 December 2004 10:14  |
Eclipse User |
|
|
|
Hello,
I have a (SWT based) GEF/draw2d Application which opens a JFrame on
Button Click (pure Swing, not SWT_AWT !)
Beside from strange effects like deadlocks when using the Clipboard if
the JFrame is opened modal, I've got one somehow fundamental error:
The JFrame is opened, causing some visuals "from behind" to be marked as
invalid. The asynchronous (GEF-) repaint manager triggers something like
a repaint event with "Display.getCurrent().asyncExec(....)", which
results in a NullPointerException...
Is there no current display, if some Swing component has the focus ?
It sound plausible, as the current thread is no SWT ui-thread...
but how can I work around this issue?
Changing the call into "Display.getDefault()" is no solution, as the
code is part of the GEF.
Any ideas ?
Thanks in advance
Florian
|
|
|
Re: No Display.getCurrent() when opening Swing Component [message #446937 is a reply to message #446929] |
Mon, 06 December 2004 12:40  |
Eclipse User |
|
|
|
Enter a bug report against GEF. Display.getCurrent() can return null.
"Florian Georg" <FGeorg@gmx.de> wrote in message
news:cp1t07$fka$1@www.eclipse.org...
> Hello,
>
> I have a (SWT based) GEF/draw2d Application which opens a JFrame on
> Button Click (pure Swing, not SWT_AWT !)
> Beside from strange effects like deadlocks when using the Clipboard if
> the JFrame is opened modal, I've got one somehow fundamental error:
>
> The JFrame is opened, causing some visuals "from behind" to be marked as
> invalid. The asynchronous (GEF-) repaint manager triggers something like
> a repaint event with "Display.getCurrent().asyncExec(....)", which
> results in a NullPointerException...
> Is there no current display, if some Swing component has the focus ?
> It sound plausible, as the current thread is no SWT ui-thread...
> but how can I work around this issue?
> Changing the call into "Display.getDefault()" is no solution, as the
> code is part of the GEF.
>
> Any ideas ?
>
> Thanks in advance
> Florian
|
|
|
Powered by
FUDForum. Page generated in 0.04627 seconds