Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » General (non-technical) » Eclipse Foundation » What's wrong with this program? (Server Java)(easyeclipse server Java)
icon1.gif  What's wrong with this program? (Server Java) [message #657641] Thu, 03 March 2011 09:48 Go to next message
Zhg Mising name is currently offline Zhg Mising name
Messages: 81
Registered: March 2011
Member
According to easyeclipse help, I build a swt application.
the java and class are as follow,
package org.firstpicture;

public class FirstDisp1 {

/**
* @param args
*/
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();
}

}

when run, I get a prompt in red word,

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Display cannot be resolved to a type
Display cannot be resolved to a type
Shell cannot be resolved to a type
Shell cannot be resolved to a type

at org.firstpicture.FirstDisp1.main(FirstDisp1.java:11)


what's wrong?
how to debug?
Re: What's wrong with this program? (Server Java) [message #657705 is a reply to message #657641] Thu, 03 March 2011 11:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25746
Registered: July 2009
Senior Member
This isn't a technical newsgroup/forum. Use eclipse.newcomer if you're
not sure where to post.

In terms of your question, it doesn't sound like you've even set up your
project to compile properly. Surely you must be seeing error messages
about the fact that you've not imported Display...


cnnihao@126.com wrote:
> According to easyeclipse help, I build a swt application.
> the java and class are as follow,
> package org.firstpicture;
>
> public class FirstDisp1 {
>
> /**
> * @param args
> */
> 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();
> }
>
> }
>
> when run, I get a prompt in red word,
>
> Exception in thread "main" java.lang.Error: Unresolved compilation
> problems: Display cannot be resolved to a type
> Display cannot be resolved to a type
> Shell cannot be resolved to a type
> Shell cannot be resolved to a type
>
> at org.firstpicture.FirstDisp1.main(FirstDisp1.java:11)
>
> what's wrong?
> how to debug?
Re: What's wrong with this program? (Server Java) [message #658160 is a reply to message #657705] Mon, 07 March 2011 03:38 Go to previous message
Zhg Mising name is currently offline Zhg Mising name
Messages: 81
Registered: March 2011
Member
thank you, I get it.


Thanks,
Previous Topic:Webinar: Gemini - Apr. 13
Next Topic:Eclipse Scout Webinar
Goto Forum:
  


Current Time: Sat Apr 19 08:53:31 EDT 2014

Powered by FUDForum. Page generated in 0.04700 seconds