How to use a TitleAreaDialog as main Window [message #448955] |
Sun, 16 January 2005 16:55  |
Eclipse User |
|
|
|
I am really new to Eclipse and so I try out different things and run fro=
m =
on problem into another.
Today i wanted to use a TitleAreaDialog as main Window - the JVM crached=
.. =
here is the code snippet, that shows too, that I tried different things =
=
without success.
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.widgets.*;
public class Main
{ public static void main(String[] args)
{ //Display display =3D new Display();
//Shell shell =3D new Shell(display);
//shell.setSize(500, 500);
//shell.open();
=
TitleAreaDialog dlg =3D new TitleAreaDialog(new Shell());
//dlg.create();
dlg.setTitle("Test");
dlg.open();
=
//shell.dispose();
/*MessageBox m =3D new MessageBox(new Shell());
m.setMessage("Hello, World");
m.open();*/
}
}
The JVM Launcher crashes at the line
TitleAreaDialog dlg =3D new TitleAreaDialog(new Shell());
with the message
"Fatal exception occured.The program will exit"
The exception is:
"java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IStatus
at Main.main(Main.java:25)"
That is the line described above.
Strange - if let run the message box comment out below the whole things =
=
work.
What did I do wrong ?
Are there any good online documentation that can explain me easy things =
=
like that ? I found documentation about SWT and JFrame classes - they ar=
e =
really good, but they just tell the functions and varibales, but not, ho=
w =
to create simple things. On the other side there are a lot of high compl=
ex =
examples - i just look for simple beginners examples to copy them and tr=
y =
them, before I start my own projects.
Thomas
|
|
|
|
|
Re: How to use a TitleAreaDialog as main Window [message #448962 is a reply to message #448960] |
Sun, 16 January 2005 23:03  |
Eclipse User |
|
|
|
Originally posted by: nickthat.yahoo.com
Thomas,
What you need to do is put a call like the following before you create
your TitleAreaDialog
new Display();
Nick
Thomas wrote:
> To clarify some things:
> It crashes with the following source code
>> import org.eclipse.jface.dialogs.TitleAreaDialog;
>> import org.eclipse.swt.widgets.*;
>>
>> public class Main
>> { public static void main(String[] args)
>> {
>> TitleAreaDialog dlg = new TitleAreaDialog(new Shell());
>> dlg.setTitle("Test");
>> dlg.open();
>> }
>> }
>>
> It doesn't crash when I call a message dialog.
>> import org.eclipse.jface.dialogs.TitleAreaDialog;
>> import org.eclipse.swt.widgets.*;
>>
>> public class Main
>> { public static void main(String[] args)
>> { MessageBox m = new MessageBox(new Shell());
>> m.setMessage("Hello, World");
>> m.open();
>> }
>> }
|
|
|
Powered by
FUDForum. Page generated in 0.03713 seconds