Skip to main content



      Home
Home » Newcomers » Newcomers » newbie: very simple problem strange error
newbie: very simple problem strange error [message #167628] Sun, 27 August 2006 22:29 Go to next message
Eclipse UserFriend
Originally posted by: go.away.com

hi-
i keep getting this message when i use shell
Syntax error on token";",{ expected after this token.
the error is on line 15.
i had such good productivity and than this.

any help figuring out why i am getting this syntax error
is a huge help.

thanks,
jim


package bcalc;

import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.SWT;
public class Foo {

public static void main(String args[]) {

Shell shell2 = new Shell();
VendorListViewer vendorListViewer = new
VendorListViewer("bb",shell2,SWT.V_SCROLL);
}

Display display = new Display();
final Shell shell = new Shell(display); //error on this line
/**
* @param args
*/
while(!shell.isDisposed()){
if (!display.readAndDispatch()){
display.sleep();

}
}
display.dispose();

}
}
Re: newbie: very simple problem strange error [message #167636 is a reply to message #167628] Sun, 27 August 2006 23:16 Go to previous messageGo to next message
Eclipse UserFriend
You closed the class definition two lines above the declaration for the
Display object.


On 8/27/06 8:29 PM, in article ectke7$o8q$1@utils.eclipse.org,
"3rdshiftcoder" <go@away.com> wrote:

>
> package bcalc;
>
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.SWT;
> public class Foo {
>
> public static void main(String args[]) {
>
> Shell shell2 = new Shell();
> VendorListViewer vendorListViewer = new
> VendorListViewer("bb",shell2,SWT.V_SCROLL);
> }
>
> Display display = new Display();
> final Shell shell = new Shell(display); //error on this line
> /**
> * @param args
> */
> while(!shell.isDisposed()){
> if (!display.readAndDispatch()){
> display.sleep();
>
> }
> }
> display.dispose();
>
> }
> }
Re: newbie: very simple problem strange error [message #167644 is a reply to message #167636] Sun, 27 August 2006 23:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: go.away.com

hi j.michael dean-
it still doesnt compile with the same error.
i tried to make this as absolutely basic as possible this time.
sorry,
jim

package bcalc;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.SWT;
public class Foo {
Display display = new Display();
final Shell shell = new Shell(display);
while(!shell.isDisposed()){
if (!display.readAndDispatch()){
display.sleep();
}
}
display.dispose();
}

"J Michael Dean" <mdean77@comcast.net> wrote in message
news:C117BC12.16D18%mdean77@comcast.net...
> You closed the class definition two lines above the declaration for the
> Display object.
>
>
Re: newbie: very simple problem strange error IGNORE SOLVED [message #167659 is a reply to message #167644] Mon, 28 August 2006 00:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: go.away.com

i think i have eclipse configuration issues.
i started a brand new project and am not using all the old
settings that were correct from the other project.
i will fine tune it and it will probably run right.

sorry again,
jim


"3rdshiftcoder" <go@away.com> wrote in message
news:ecto97$4fv$1@utils.eclipse.org...
> hi j.michael dean-
> it still doesnt compile with the same error.
> i tried to make this as absolutely basic as possible this time.
> sorry,
> jim
>
> package bcalc;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.SWT;
> public class Foo {
> Display display = new Display();
> final Shell shell = new Shell(display);
> while(!shell.isDisposed()){
> if (!display.readAndDispatch()){
> display.sleep();
> }
> }
> display.dispose();
> }
>
> "J Michael Dean" <mdean77@comcast.net> wrote in message
> news:C117BC12.16D18%mdean77@comcast.net...
>> You closed the class definition two lines above the declaration for the
>> Display object.
>>
>>
>
>
Re: newbie: very simple problem strange error [message #167667 is a reply to message #167636] Mon, 28 August 2006 00:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: go.away.com

thanks J,
i figured it out now.
i forgot to enclose anything outside of main in a method.
+ configuration problems.

my memory is not as good as i'd like.

thanks again,
jim


"J Michael Dean" <mdean77@comcast.net> wrote in message
news:C117BC12.16D18%mdean77@comcast.net...
> You closed the class definition two lines above the declaration for the
> Display object.
>
>
> On 8/27/06 8:29 PM, in article ectke7$o8q$1@utils.eclipse.org,
> "3rdshiftcoder" <go@away.com> wrote:
>
>>
>> package bcalc;
>>
>> import org.eclipse.swt.widgets.Shell;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.SWT;
>> public class Foo {
>>
>> public static void main(String args[]) {
>>
>> Shell shell2 = new Shell();
>> VendorListViewer vendorListViewer = new
>> VendorListViewer("bb",shell2,SWT.V_SCROLL);
>> }
>>
>> Display display = new Display();
>> final Shell shell = new Shell(display); //error on this line
>> /**
>> * @param args
>> */
>> while(!shell.isDisposed()){
>> if (!display.readAndDispatch()){
>> display.sleep();
>>
>> }
>> }
>> display.dispose();
>>
>> }
>> }
>
Re: newbie: very simple problem strange error IGNORE SOLVED [message #167815 is a reply to message #167659] Mon, 28 August 2006 10:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jochen.wuttke.gmx.de.invalid

If I'm not completely mistaken, what you now posted is not correct either.
You can't have a look outside a methode. Take a look at the Java Tutorial if
you have problems with these basic errors.

3rdshiftcoder wrote:
>
> i think i have eclipse configuration issues.
> i started a brand new project and am not using all the old
> settings that were correct from the other project.
> i will fine tune it and it will probably run right.
>
> sorry again,
> jim
>
>
> "3rdshiftcoder" <go@away.com> wrote in message
> news:ecto97$4fv$1@utils.eclipse.org...
>> hi j.michael dean-
>> it still doesnt compile with the same error.
>> i tried to make this as absolutely basic as possible this time.
>> sorry,
>> jim
>>
>> package bcalc;
>> import org.eclipse.swt.widgets.Shell;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.SWT;
>> public class Foo {
>> Display display = new Display();
>> final Shell shell = new Shell(display);
>> while(!shell.isDisposed()){
>> if (!display.readAndDispatch()){
>> display.sleep();
>> }
>> }
>> display.dispose();
>> }
>>
>> "J Michael Dean" <mdean77@comcast.net> wrote in message
>> news:C117BC12.16D18%mdean77@comcast.net...
>>> You closed the class definition two lines above the declaration for the
>>> Display object.
>>>
>>>
>>
>>
>
>
Re: newbie: very simple problem strange error [message #167972 is a reply to message #167628] Tue, 29 August 2006 00:37 Go to previous message
Eclipse UserFriend
Originally posted by: wayne.beaton._NOSPAM_eclipse.org

3rdshiftcoder wrote:
> hi-
> i keep getting this message when i use shell
> Syntax error on token";",{ expected after this token.
> the error is on line 15.
> i had such good productivity and than this.
>
> any help figuring out why i am getting this syntax error
> is a huge help.
>
> thanks,
> jim
>
>
> package bcalc;
>
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.SWT;
> public class Foo {
>
> public static void main(String args[]) {
>
> Shell shell2 = new Shell();
> VendorListViewer vendorListViewer = new
> VendorListViewer("bb",shell2,SWT.V_SCROLL);
> }
>
> Display display = new Display();
> final Shell shell = new Shell(display); //error on this line
> /**
> * @param args
> */
> while(!shell.isDisposed()){
> if (!display.readAndDispatch()){
> display.sleep();
>
> }
> }
> display.dispose();
>
> }
> }

Do you really mean to have the close curly-brace on line 12?

Wayne
Previous Topic:Perforce plugin?
Next Topic:PDE Build tricks to generate Javadocs
Goto Forum:
  


Current Time: Tue Sep 16 07:18:35 EDT 2025

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

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

Back to the top