Skip to main content


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 14:48 Go to next message
Zhg Mising name is currently offline Zhg Mising nameFriend
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 16:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: What's wrong with this program? (Server Java) [message #658160 is a reply to message #657705] Mon, 07 March 2011 08:38 Go to previous message
Zhg Mising name is currently offline Zhg Mising nameFriend
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: Thu Apr 25 11:18:30 GMT 2024

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

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

Back to the top