Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Problem by resolving typs by HalloWorld(typ handling problem)
Problem by resolving typs by HalloWorld [message #1434763] Tue, 30 September 2014 15:00 Go to next message
Franz Raaber is currently offline Franz RaaberFriend
Messages: 2
Registered: September 2014
Junior Member
After mine starting with Java, did I have by the Realisation of "HelloWorld.java" treyed to realise "HelloWorldSWT". But this Windows Version of HelloWorld [
public class HelloWorldSWT {

public static void main(String[] args) {
// TODO Auto-generated method stub
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Hello world!");
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch())
display.sleep();
}
display.dispose();
}

}

] didn't be compiled or interpreted in mine sense.
I get in the line "Display display = new Display();" the message/errore "Display can not resolved to a type", and in the "Shell shell = new Shell(display);"-line the errore "Shell shell = new Shell(display);" in the similar way!
What do I've to do? What is wrong?
I think and thought that the problem the missing definition of the variables "Display" and "Shell" is, but is that realy the fact, by the reason that I found these code on a book and a popluar web-page?

Cu
Franz Sad
Re: Problem by resolving typs by HalloWorld [message #1435055 is a reply to message #1434763] Wed, 01 October 2014 01:04 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6570
Registered: July 2009
Senior Member
Most likely you need to add the swt.jars in your projects build path.

Tom

On 30.09.14 10:10, Franz Raaber wrote:
> After mine starting with Java, did I have by the Realisation of "HelloWorld.java" treyed to realise "HelloWorldSWT". But this Windows Version of HelloWorld [
> public class HelloWorldSWT {
>
> public static void main(String[] args) {
> // TODO Auto-generated method stub
> Display display = new Display();
> Shell shell = new Shell(display);
> shell.setText("Hello world!");
> shell.open();
> while(!shell.isDisposed()) {
> if(!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
> }
>
> }
> ] didn't be compiled or interpreted in mine sense.
> I get in the line "Display display = new Display();" the message/errore "Display can not resolved to a type", and in the "Shell shell = new Shell(display);"-line the errore "Shell shell = new Shell(display);" in the similar way!
> What do I've to do? What is wrong?
> I think and thought that the problem the missing definition of the variables "Display" and "Shell" is, but is that realy the fact, by the reason that I found these code on a book and a popluar web-page?
>
> Cu
> Franz :(
>
Previous Topic:eclipse error
Next Topic:jzy3d Setup in Eclipse Tips
Goto Forum:
  


Current Time: Fri Nov 27 08:50:26 GMT 2020

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

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

Back to the top