Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » No Display.getCurrent() when opening Swing Component
No Display.getCurrent() when opening Swing Component [message #446929] Mon, 06 December 2004 15:14 Go to next message
Florian Georg is currently offline Florian GeorgFriend
Messages: 22
Registered: July 2009
Junior Member
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 17:40 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
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
Previous Topic:Shell.computeTrim()
Next Topic:Redrawing newly created widget
Goto Forum:
  


Current Time: Fri Apr 26 00:38:07 GMT 2024

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

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

Back to the top