I am trying to find my way around with the Google Web Toolkit. Right now I am trying to get a Canvas
widget up and running.
But I am getting this error and
You cannot create a Canvas with the UI:Binder, because there is no zero-arg constructor, nor a @UIConstructor
.
I would suggst to create a warpper (A simplePanel) and within your Wrapper-Code, you can create a Canvas, by calling Canvas.createIfSupported():
The canvas itself is prvided.
@UiField(provided = true)
Canvas canvas;
Before you call binder.createAndBindUi(this);
you will have to create the Canvas:
canvas = Canvas.createIfSupported()
I have no simple example, but maybe, this link is helpful: https://code.google.com/p/gwtgae2011/source/browse/src/main/java/com/googlecode/gwtgae2011/client/main/SketchView.java?r=8e7169e7fbb411f320f99f77dcdb27efa27b727a
You also could use a CanvasElement, like described in this question: GWT uibinder CanvasElement wont resize when deployed