Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Java/SWT/Webstart application crashes on Linux
Java/SWT/Webstart application crashes on Linux [message #529518] Mon, 26 April 2010 09:16 Go to next message
Eclipse UserFriend
Originally posted by: txbarth.web.de

Hi,
the following code crashes on Linux (e.g. Ubuntu 9.04/9.10; Sun Java 6
installed instead of openJDK) as soon as I click the OK-Button of the
message box. But it only crashes when the application is started with
Java Webstart and I dont get any error messages!
There are no problems on Windows (XP/Vista/7) or when it is started as
application in Eclipse.

The code simply creates a shell with a button to display a message box.
Any idea how to fix it?


(Tested with SWT 3.4 and SWT 3.5)
package de.test;

import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.*;

import de.control.Informer;

public class HelloWorld {
private static Display display = new Display ();
private static Shell shell = new Shell(display);

public static void main(String[] args) {

Button ok = new Button (shell, SWT.PUSH);
ok.setText ("Warning");
ok.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Informer.sendWarning(HelloWorld.getShell(), "Hello Warning");
}
});

shell.setLayout(new RowLayout ());
shell.setText("Hello World Test");
shell.setSize(1024, 768);
shell.open ();

while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}

public static Shell getShell() {
return shell;
}
}


package de.control;

import org.eclipse.swt.SWT;

public class Informer {

public Informer() {

}

public static void sendWarning(final Shell parentShell, final String
message) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
if(parentShell.isDisposed()) return;

MessageBox box = new MessageBox(parentShell, SWT.ICON_WARNING |
SWT.OK);
box.setText("Click OK and it will crash");
box.setMessage(message);
box.open();
}
});
}

}
Re: Java/SWT/Webstart application crashes on Linux [message #538239 is a reply to message #529518] Mon, 07 June 2010 04:01 Go to previous messageGo to next message
Varejao  is currently offline Varejao Friend
Messages: 4
Registered: June 2010
Junior Member
I m having a similar problem. When my RCP application open a file dialog and some other dialogs, it freezes and crash after I click the Ok or Cancel button. Strange is that not all dialogs that cause the application to crash. And the problem happens whenever I try to use the file dialog
In Windows everything works fine. And the program crashes only when I use Java Web Start.

Any sugestion?

Thanks,

Varejao
Re: Java/SWT/Webstart application crashes on Linux [message #538264 is a reply to message #538239] Mon, 07 June 2010 07:40 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Did you refer the First sticky post - Problems with Eclipse 3.5.x on Ubuntu? Read this

---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Java/SWT/Webstart application crashes on Linux [message #538377 is a reply to message #538239] Mon, 07 June 2010 13:50 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
It sounds like you're seeing
https://bugs.eclipse.org/bugs/show_bug.cgi?id=280649 .

Grant


"Varejao" <juninho@varejao.org> wrote in message
news:huhr01$inp$1@build.eclipse.org...
> I m having a similar problem. When my RCP application open a file dialog
and some other dialogs, it freezes and crash after I click the Ok or Cancel
button. Strange is that not all dialogs that cause the application to crash.
And the problem happens whenever I try to use the file dialog
> In Windows everything works fine. And the program crashes only when I use
Java Web Start.
>
> Any sugestion?
>
> Thanks,
>
> Varejao
Previous Topic:Handle Focus in Custom Controls
Next Topic:Whatever happend to the book "SWT: The Standard Widget Toolkit, Volume 2"?
Goto Forum:
  


Current Time: Wed Apr 24 14:42:38 GMT 2024

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

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

Back to the top