SWT + JME: FileDialog freezes (example included)


i'm currently creating an Eclipse RCP powered visualisation software which includes 3d graphics based on jme.

The problem now is, that whenever jme engine is running FileDialogs are going to freeze. If the 3d graphics are shutdown they will work as they should.

I added these two lines to the JMESWTTest to demonstrate the problem:

FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);


When you start you will see the FileDialog. It will look just fine, the cursor is blinking. But as soon as you click anywhere it freezes.

Any idea is greatly appreciated, thank you!

Nobody has encountered that problem yet? Somehow jme and swt produce a deadlock at that moment.

Well, here is a bad AWT-FileDialog based workaround:


Furthermore i attached a copy of it.


I just discovered another bug with this implementation:

Always select a file and hit Open. When you doubleclick on a file the jme-swt canvas will freeze! (because it gets disposed?!?)


Instead of creating a new frame it is better to base the frame on top of the SWT shell. So focus and toFront() will work correctly.

      Shell shell = HandlerUtil.getActiveWorkbenchWindow(event).getShell();
      Composite comp = new Composite(shell, SWT.EMBEDDED);
      frame = SWT_AWT.new_Frame(comp);

Just never doubleclick...

i tried the JMESWTTest you pasted and i couldn't reproduce the problem.

I'm using windows 64 and had to download a new 64bit swt jar tho.

Could you try with a newer swt jar ?

Thank you very much for the hint. Well the bug exists in version 3.5.1 Final Release (at least win32) but it works fine with 3.6 Milestone 5 Release. I just hope that this early version doesn't have a bug somewhere else which affects my program  ;)

hehe great :slight_smile: