GWT1.5 milestone 2 problem

24 views
Skip to first unread message

Kurt

unread,
May 16, 2008, 4:31:18 PM5/16/08
to Google Web Toolkit
Hi
I'm new to to GWT and I'm trying to create a project which uses derby.
I've found some interesting tutorials which have helped me alot but
I'm having problems with the GUI. I'm using one entry-point and one
module to keep it simple. The packages that are relevant is com.client
and com.client.gui. Com.client contains my entry-point class and
com.client.gui contains 3 files: LoginPane extends VerticalPanel,
MyDockPanel extends DockPanel and MyClickListener implements
ClickListener.

When I delete MyClickListener, it works, when I add it to
com.client.gui, following error is thrown in hosted mode:
[TRACE] Analyzing source in module 'com.projectMultiTrans'
[ERROR] Errors in 'C:\school\workspace\projectMultiTrans\src\com\client
\gui\MyClickListener.java'
[ERROR] Line 15: The method onClick(Widget) of type MyClickListener
must override a superclass method


This is howMyClickListener looks like.

public class MyClickListener implements ClickListener{

Login loginPane;

public MyClickListener(Login loginPane){
this.loginPane = loginPane;
}

@Override
public void onClick(Widget sender) {
// TODO Auto-generated method stub
// MyDockPanel dockPanel = (MyDockPanel)loginPane.getParent();
// dockPanel.setUsername(loginPane.getLogin());
// System.out.println(loginPane.getLogin());
}
}

Does anybody knows what's the problem. Does the gwt-compiler supports
"implements"?
thanks

Ian Petersen

unread,
May 16, 2008, 4:45:49 PM5/16/08
to Google-We...@googlegroups.com
On Fri, May 16, 2008 at 4:31 PM, Kurt <Steven...@gmail.com> wrote:
> Does anybody knows what's the problem. Does the gwt-compiler supports
> "implements"?

The problem is the @Override annotation. For some reason,
implementing a method defined in an interface doesn't fall under the
purview of @Override. I think that might have changed in Java 1.6,
but GWT 1.5 is compatible with Java 1.5, not 1.6. Just delete the
@Override and things should be good.

Ian

--
Tired of pop-ups, security holes, and spyware?
Try Firefox: http://www.getfirefox.com

Kurt

unread,
May 16, 2008, 5:08:09 PM5/16/08
to Google Web Toolkit
You're right, it works. I didn't add these annotations but eclipse has
added them automatically.
I've now switched to java 1.5 in eclipse and it works. It's rather
frustrating but I'm glad it compiles without errors.
thanks

On 16 mei, 22:45, "Ian Petersen" <ispet...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages