Skip to main content



      Home
Home » Newcomers » Newcomers » Build a standalone SWT Application
Build a standalone SWT Application [message #20842] Mon, 31 January 2005 02:58 Go to next message
Eclipse UserFriend
Originally posted by: antoi.darti.tiscali.fr

Hello i installed Eclipse 3.O.1
i am trying the tutorial "Hello World" for SWT standalone appli
After adding the external swt.jar libraries, as said in the tutorial,
I create a class HelloWorld main,
when I copy paste ;in the main :
Display display = new Display ();
Shell shell = new Shell (display);
Label label = new Label (shell, SWT.CENTER);
the three types are not recognized ?
Display cannot be resolved or is not a type

Is it because I have to add in the path where are the swt libraries ?

Thank you for help

Antoine
Re: Build a standalone SWT Application [message #21578 is a reply to message #20842] Mon, 31 January 2005 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.gmail.com

Antoine,

Did you add the imports for the swt classes? Specifically:
import org.eclipse.swt.widgets.*;

You should be able to use Code Assist and Organize Imports to fix this
problem as well, if the SWT library has been correctly added to your
project.

Hope this helps,

- Jeff

antoine dartiguenave wrote:
> Hello i installed Eclipse 3.O.1
> i am trying the tutorial "Hello World" for SWT standalone appli
> After adding the external swt.jar libraries, as said in the tutorial,
> I create a class HelloWorld main,
> when I copy paste ;in the main :
> Display display = new Display ();
> Shell shell = new Shell (display);
> Label label = new Label (shell, SWT.CENTER);
> the three types are not recognized ?
> Display cannot be resolved or is not a type
>
> Is it because I have to add in the path where are the swt libraries ?
>
> Thank you for help
>
> Antoine
>
>
Re: Build a standalone SWT Application [message #21848 is a reply to message #21578] Mon, 31 January 2005 17:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Chris_Laffra.ca.ibm.com

I always use Ctrl+Shift+O to fix missing/duplicate imports.

--
Chris Laffra, http://eclipsefaq.org


"Jeff Myers" <myersj@gmail.com> wrote in message
news:ctlpjf$k4g$1@www.eclipse.org...
> Antoine,
>
> Did you add the imports for the swt classes? Specifically:
> import org.eclipse.swt.widgets.*;
>
> You should be able to use Code Assist and Organize Imports to fix this
> problem as well, if the SWT library has been correctly added to your
> project.
>
> Hope this helps,
>
> - Jeff
>
> antoine dartiguenave wrote:
> > Hello i installed Eclipse 3.O.1
> > i am trying the tutorial "Hello World" for SWT standalone appli
> > After adding the external swt.jar libraries, as said in the tutorial,
> > I create a class HelloWorld main,
> > when I copy paste ;in the main :
> > Display display = new Display ();
> > Shell shell = new Shell (display);
> > Label label = new Label (shell, SWT.CENTER);
> > the three types are not recognized ?
> > Display cannot be resolved or is not a type
> >
> > Is it because I have to add in the path where are the swt libraries ?
> >
> > Thank you for help
> >
> > Antoine
> >
> >
Re: Build a standalone SWT Application [message #25762 is a reply to message #20842] Sat, 05 February 2005 18:15 Go to previous message
Eclipse UserFriend
Originally posted by: mhoram.clandlan.net

antoine dartiguenave wrote:
> Hello i installed Eclipse 3.O.1
> i am trying the tutorial "Hello World" for SWT standalone appli
> After adding the external swt.jar libraries, as said in the tutorial,
> I create a class HelloWorld main,
> when I copy paste ;in the main :
> Display display = new Display ();
> Shell shell = new Shell (display);
> Label label = new Label (shell, SWT.CENTER);
> the three types are not recognized ?
> Display cannot be resolved or is not a type
>
> Is it because I have to add in the path where are the swt libraries ?
>
> Thank you for help
>
> Antoine
>
>
If you have already added swt.jar to Java Build Path you will need to
import the needed classes to the project, ctrl+shift+o will do it for
you, if asked choose the swt ones, no the awt.
Previous Topic:swt tutorial in eclipse 3.0.1 on macosx 10.3.7
Next Topic:eclipse executable
Goto Forum:
  


Current Time: Sat May 10 17:49:59 EDT 2025

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

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

Back to the top