Try to add a ";" after the JS comment of getUserAgent:
public static native String getUserAgent() /*-{
return navigator.userAgent.toLowerCase()
}-*/;
Olivier
On 20 juin, 17:55, Shedokan <[email protected]> wrote:
> I have this Class:
>
> package com.testproject.client;
>
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.core.client.GWT;
>
> /**
> * Entry point classes define <code>onModuleLoad()</code>.
> */
> public class Test implements EntryPoint {
>
> /**
> * This is the entry point method. Initialize you GWT module here.
> */
> public void onModuleLoad() {
> // Writes Hello World to the module log window.
> GWT.log("Hello World!", null);
> GWT.log(getUserAgent(), null);
> }
>
> public static native String getUserAgent() /*-{
> return navigator.userAgent.toLowerCase()
> }-*/
>
> }
>
> Everything should work fine but somehow I get these three errors:
> Native methods do not specify a body
> Syntax error on token ")", { expected after this token
> Syntax error, insert "}" to complete ClassBody
>
> Can anyone tell me what is the problem?
>
> Thanks
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.