Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
CssImport when using Component Exporter by Mikhail Shabarov, 1 month ago
Vaadin with gwtgraphics (
Hello there
I can not track down the error for that piece of code, I have all imports and libraries.
Could you point me to my error.
package info.iniko.mycanvas.vaadin;
import com.google.gwt.user.client.ui.RootPanel;
import com.vaadin.Application;
import com.vaadin.ui.Window;
import org.vaadin.gwtgraphics.client.DrawingArea;
/**
*
* @author jm.iniko
* @version
*/
public class CanvasApplication extends Application {
@Override
public void init() {
Window mainWindow = new Window("CanvasApplication");
DrawingArea canvas = new DrawingArea(400, 400);
RootPanel.get().add(canvas);
setMainWindow(mainWindow);
}
}
The exception raised is following (environment glassfish+netbeans)
java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable in client code! It cannot be called, for example, from server code. If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor.
seems that the code on google code is not working properly
Thanks again for any support,
JiM
Last updated on May, 7th 2012
Hi,
GWT Graphics is a pure GWT library, so you cannot use it in the server side code of Vaadin. To use use GWT Graphics with Vaadin, you have to create your own widget.
-Henri
Last updated on May, 8th 2012
+1
You cannot reply to this thread.