Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5E4CD343 for ; Sat, 7 Jul 2012 12:18:02 +0000 (UTC) Received: (qmail 59088 invoked by uid 500); 7 Jul 2012 12:18:02 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 58845 invoked by uid 500); 7 Jul 2012 12:17:59 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 58816 invoked by uid 99); 7 Jul 2012 12:17:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jul 2012 12:17:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pavanraju.mca@gmail.com designates 209.85.160.54 as permitted sender) Received: from [209.85.160.54] (HELO mail-pb0-f54.google.com) (209.85.160.54) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jul 2012 12:17:50 +0000 Received: by pbbro2 with SMTP id ro2so17388696pbb.13 for ; Sat, 07 Jul 2012 05:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=xtSRWDvoeP5YhzGLSoJu+lmhjtA416RG9C3w/wBu1dk=; b=mrEeBq6pOPj7wzquhhB4x1RubCVyWjWHe1KXVEYa0FuJxmMA53SwCnqPaFDvX+hkOS hfXhUsP6+K0iYgUp60VtT4v3WEfc8pwuvK/SW8anHxGaMyrh7cMlxTvDPwJuBvkzAwzY 3wUP4DsCXO4JyRrmQbqBtf0PY+6n0yDkdHyyOaNnAMpPB1M3rbjAZIHSDhInGnttKSee jqNXiuSWiKr3lrh/Zl/ksudiFN3QNj4PgSQpNbE0eHvtySj+m0/9JKPh6Mb8e2kb/EfQ aNoBQeaPDWaH/uLAasIkEHXYYF/PwNXqWYHs59segT6+O2vg904gji4mP5c/UrEnKISy xqPA== MIME-Version: 1.0 Received: by 10.68.232.161 with SMTP id tp1mr44420289pbc.44.1341663449411; Sat, 07 Jul 2012 05:17:29 -0700 (PDT) Received: by 10.68.129.6 with HTTP; Sat, 7 Jul 2012 05:17:29 -0700 (PDT) In-Reply-To: References: Date: Sat, 7 Jul 2012 17:47:29 +0530 Message-ID: Subject: I had a question on inserting an Image in TableView. From: V SANTOSH PAVAN RAJU Bs To: user@pivot.apache.org Content-Type: multipart/alternative; boundary=047d7b33cb904f6f9704c43c5d5f --047d7b33cb904f6f9704c43c5d5f Content-Type: text/plain; charset=ISO-8859-1 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. --047d7b33cb904f6f9704c43c5d5f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

I have created a Table vi= ew 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 pl= ace the image from Java code it is not working and showing me an Exception = as:
=A0java.net.MalformedURLException: no protocol: attachment.png<= /div>

I use the following code insert am = Image:

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

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

public Image getAddAttachment() {
return addAttachment;
}

public voi= d setAddAttachment(Image addAttachment) {
this.addAttachment =3D addAttachment;
}

public void setAddAttachment= (URL bURL) {
=A0 =A0 =A0 =A0 Image b =3D (Image)ApplicationContex= t.getResourceCache().get(bURL);

=A0 =A0 =A0 =A0 if (b =3D=3D null) {
=A0 =A0 = =A0 =A0 =A0 =A0 try {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 b =3D Image= .load(bURL);
=A0 =A0 =A0 =A0 =A0 =A0 } catch (TaskExecutionExcept= ion exception) {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 throw new Runtim= eException(exception);
=A0 =A0 =A0 =A0 =A0 =A0 }

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

=A0 =A0 =A0 =A0 setAddAttachment(b);
=A0 =A0 }

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