gwt graphics and gwt beginner- unable to display a raster image on screen

49 views
Skip to first unread message

arvindikchari

unread,
Mar 5, 2012, 9:19:37 AM3/5/12
to gwt-gr...@googlegroups.com
I am trying to add an image to the canvas, and later plan to rotate the image.

This is the code I am using---

                RootPanel rootPanel = RootPanel.get();
DrawingArea canvas = new DrawingArea(800, 800);
Image img= new Image(100, 100, 141, 538, "images/bottle.jpg");
canvas.add(img);
RootPanel.get().add(canvas);

I have stored the image in "war/images/bottle.jpg"... But no image is being shown when I try to run the project as a Google Web Application- I am using Eclipse IDE with GWT and Google Plugins for Eclipse installed.

What am I doing wrong here? Is the location to store images different by default? Any help would be appreciated.

Regards,
Arvind.



Reply all
Reply to author
Forward
0 new messages