Note that there are some explanatory texts on larger screens.

plurals
  1. POSWT hangs/freezes on Linux, when deployed as Java Web Start
    primarykey
    data
    text
    <p>The Java WebStart application I am working on uses SWT for GUI, and I have recently realized a small but annoying problem. When I choose an action that uses a <code>FileDialog</code> i.e. save the image, the user interface freezes immediately after the dialog closes. The image is saved, and can be opened with a default image viewer without any problem, but the application is non-responsive from then on, and I am forced to kill the application.</p> <p>I noticed that the result is the same when try to open a file using a <code>FileDialog</code>, if I instead open the same file by sending it as an argument by using the jnlp file, it works fine, so I don't think it's a problem with the local filesystem. </p> <p>I have tried to replicate the problem on windows only to see that it works fine on Win 7. As a second attempt to troubleshoot, I tried to save an image from the local version of the application (in other words, non-JWS) and that works fine as well... </p> <p>I was suspecting a permissions problem on the jnlp file, but all-permissions are given to the application, and signatures are all ok as well (the fact that the app starts points to that). Besides the image file is written anyways, so it can't really be a permission thing.</p> <p>Any ideas?</p> <p><strong>UPDATE:</strong> It appears as there the problem doesn't only depend on FileDialog but any kind of graphical user interaction. Whenever SWT windows are deployed the program freezes with a gray screen, AFTER whatever action that was supposed to be done. I have copied some code below, in this particular example even if I click Cancel, the application becomes non-responsive with a gray screen. Here's some sample code:</p> <pre><code> public static boolean saveChangesBeforeDiscard(MyMain main) { if (main.isDirty()) { MessageBox messageBox = new MessageBox( main.getShell(), SWT.ICON_WARNING | SWT.YES | SWT.NO | SWT.CANCEL); messageBox.setMessage("Would you like to save the changes?"); messageBox.setText(MyMain.TOOL_NAME); int answer = messageBox.open(); if (answer == SWT.YES) { SaveFileAction save = new SaveFileAction(main); save.run(); return save.isSaved(); } else if (answer == SWT.NO) { return true; } return false; } return true; } </code></pre> <p><strong>Update 2:</strong> Btw I use Sun JDK 1.6.0. Here's the output of the java -version command:</p> <blockquote> <p>java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload