Welcome to my blog, hope you enjoy reading
RSS

Tuesday 12 February 2013

How can I check if the given URL of an image exists using GWT?

How can I check if the given URL of an image exists using GWT?

Image img = new Image("some_url/img.jpg");
img.addErrorHandler(new ErrorHandler() {                
    @Override
    public void onError(ErrorEvent event) {
        System.out.println("Error - image not loaded.");
    }
});

0 comments: