pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From V SANTOSH PAVAN RAJU Bs <pavanraju....@gmail.com>
Subject I had a question on inserting an Image in TableView.
Date Sat, 07 Jul 2012 12:17:29 GMT
Hi,

I have created a Table view in which i want to put an image, So i use the
code in "Kitchen Sink" Demo application. And the table looks ok. But now
when i tried to place the image from Java code it is not working and
showing me an Exception as:
 *java.net.MalformedURLException: no protocol: attachment.png*
*
*
I use the following code insert am Image:

URL url = new URL("/com/sample/images/attachment.png");
Bean b = new Bean();
b.setAddAttachment(url);
list.insert(b, 0);

Here Bean class has the same setter methods as it was in Your Kitchen Sink
Dem0 Application.

public Image getAddAttachment() {
return addAttachment;
}

public void setAddAttachment(Image addAttachment) {
this.addAttachment = addAttachment;
 }

public void setAddAttachment(URL bURL) {
        Image b = (Image)ApplicationContext.getResourceCache().get(bURL);

        if (b == null) {
            try {
                b = Image.load(bURL);
            } catch (TaskExecutionException exception) {
                throw new RuntimeException(exception);
            }

            ApplicationContext.getResourceCache().put(bURL, b);
        }

        setAddAttachment(b);
    }

Please help me in this regard.
-- 
Thanks & Regards
B.S.V.S.Pavan Raju.
Skype: skype_pavan1
Hyderabad.

Mime
View raw message