Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
thank you, I get it.
Previous Topic:Webinar: Gemini - Apr. 13
Next Topic:Eclipse Scout Webinar
Goto Forum:
  


Current Time: Thu Jul 10 02:31:01 EDT 2025

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

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

Back to the top