You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Scott Lanham <li...@sael.com.au> on 2009/08/04 00:40:12 UTC

Tutorial Runtime Error

Hello,

I am up to the part of the tutorial: http://cwiki.apache.org/PIVOT/labels-
image-views.html and am doing something wrong but can't figure it out.

Instead of just using the tutorial code as is I like to change things slightly 
so that I get a better feel for the toolkit. So I changed the location of the 
clock.png file but I get a "Null Image Alert" from the following code:

<Window title="Labels" maximized="true"
    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1" xmlns="pivot.wtk">
    <content>
        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
            <ImageView image="/home/scott/devel/src/clock.png" 
cursor="crosshair"/>
            <Label text="What time is it?"/>
        </FlowPane>
    </content>
</Window>

The file does exist in that location as I can take the path and paste it into a 
graphics editor. Any help appreciated.

Cheers,

Scott.

Re: Tutorial Runtime Error

Posted by Scott Lanham <li...@sael.com.au>.
Thanks for the link I will have a look.

On Tue, 4 Aug 2009 08:51:23 am Todd Volkert wrote:
> Actually, in case you haven't read it yet, the WTKX primer on the Wiki is a
> really good resource.  It can be found at
> http://cwiki.apache.org/PIVOT/wtkx-primer.html
> Cheers,
> -T
>
> On Mon, Aug 3, 2009 at 6:50 PM, Todd Volkert <tv...@gmail.com> wrote:
> > Hi Scott,
> > <ImageView image="..." /> translates to ImageView.setImage(String) (
> > http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/Image
> >View.html#setImage(java.lang.String)), where the string is a resource name
> > as per ClassLoader.getResource(String) (
> > http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getResou
> >rce(java.lang.String) ).
> >
> > Thus, the path to your image must be found on your classpath.
> >
> > Alternatively, you can prepend the string with "@" and use a relative
> > path, in which case the value will be converted to a URL relative to your
> > WTKX file, and Imageview.setImage(URL) will be called.
> >
> > Hope that helps,
> > -T
> >
> > On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au> wrote:
> >> Hello,
> >>
> >> I am up to the part of the tutorial:
> >> http://cwiki.apache.org/PIVOT/labels-
> >> image-views.html<http://cwiki.apache.org/PIVOT/labels-%0Aimage-views.htm
> >>l>and am doing something wrong but can't figure it out.
> >>
> >> Instead of just using the tutorial code as is I like to change things
> >> slightly
> >> so that I get a better feel for the toolkit. So I changed the location
> >> of the
> >> clock.png file but I get a "Null Image Alert" from the following code:
> >>
> >> <Window title="Labels" maximized="true"
> >>    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
> >> xmlns="pivot.wtk">
> >>    <content>
> >>        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
> >>            <ImageView image="/home/scott/devel/src/clock.png"
> >> cursor="crosshair"/>
> >>            <Label text="What time is it?"/>
> >>        </FlowPane>
> >>    </content>
> >> </Window>
> >>
> >> The file does exist in that location as I can take the path and paste it
> >> into a
> >> graphics editor. Any help appreciated.
> >>
> >> Cheers,
> >>
> >> Scott.


Re: Tutorial Runtime Error

Posted by Scott Lanham <li...@sael.com.au>.
Thanks. Sounds like I had better change over to 1.3.

On Tue, 4 Aug 2009 09:26:45 am Greg Brown wrote:
> As Todd mentioned earlier, you may be better off working through the
> tutorials from SVN. Quite a few things have changed between 1.2 and
> 1.3, particularly in the area of WTKX.
>
> I'd recommend that you get the latest source and run the deploy
> target, since that will build the latest version of the tutorial apps
> and documentation. However, if you just want to read the WTKX Primer,
> you can get it here:
>
> http://svn.apache.org/repos/asf/incubator/pivot/trunk/tutorials/www/wtkx_pr
>imer.template.html
>
> Greg
>
> On Aug 3, 2009, at 6:51 PM, Todd Volkert wrote:
> > Actually, in case you haven't read it yet, the WTKX primer on the
> > Wiki is a really good resource.  It can be found at
> > http://cwiki.apache.org/PIVOT/wtkx-primer.html
> >
> > Cheers,
> > -T
> >
> > On Mon, Aug 3, 2009 at 6:50 PM, Todd Volkert <tv...@gmail.com>
> > wrote:
> > Hi Scott,
> >
> > <ImageView image="..." /> translates to ImageView.setImage(String)
> > (http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/Imag
> >eView.html#setImage(java.lang.String) ), where the string is a resource
> > name as per
> > ClassLoader.getResource(String)
> > (http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getReso
> >urce(java.lang.String) ).
> >
> > Thus, the path to your image must be found on your classpath.
> >
> > Alternatively, you can prepend the string with "@" and use a
> > relative path, in which case the value will be converted to a URL
> > relative to your WTKX file, and Imageview.setImage(URL) will be
> > called.
> >
> > Hope that helps,
> > -T
> >
> >
> > On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au>
> > wrote:
> > Hello,
> >
> > I am up to the part of the tutorial:
> > http://cwiki.apache.org/PIVOT/labels- image-views.html and am doing
> > something wrong but can't figure it out.
> >
> > Instead of just using the tutorial code as is I like to change
> > things slightly
> > so that I get a better feel for the toolkit. So I changed the
> > location of the
> > clock.png file but I get a "Null Image Alert" from the following code:
> >
> > <Window title="Labels" maximized="true"
> >    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
> > xmlns="pivot.wtk">
> >    <content>
> >        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
> >            <ImageView image="/home/scott/devel/src/clock.png"
> > cursor="crosshair"/>
> >            <Label text="What time is it?"/>
> >        </FlowPane>
> >    </content>
> > </Window>
> >
> > The file does exist in that location as I can take the path and
> > paste it into a
> > graphics editor. Any help appreciated.
> >
> > Cheers,
> >
> > Scott.


Re: Tutorial Runtime Error

Posted by Todd Volkert <tv...@gmail.com>.
The "deploy" target will build a set of jar files (our libraries) and war
files (our demos and tutorials) into the lib directory.  To build the
javadocs, run the "doc" target.  Alternatively, it's not linked to yet, but
you can get fairly up-to-date javadocs for the 1.3 snapshots at
http://incubator.apache.org/pivot/1.3/docs/api/

Cheers,
-T

On Mon, Aug 3, 2009 at 11:18 PM, Scott Lanham <li...@sael.com.au> wrote:

> The code from SVN built okay but when I ran the deploy target the API docs
> went missing.
>
> On Tue, 4 Aug 2009 09:26:45 am Greg Brown wrote:
> > As Todd mentioned earlier, you may be better off working through the
> > tutorials from SVN. Quite a few things have changed between 1.2 and
> > 1.3, particularly in the area of WTKX.
> >
> > I'd recommend that you get the latest source and run the deploy
> > target, since that will build the latest version of the tutorial apps
> > and documentation. However, if you just want to read the WTKX Primer,
> > you can get it here:
> >
> >
> http://svn.apache.org/repos/asf/incubator/pivot/trunk/tutorials/www/wtkx_pr
> >imer.template.html
> >
> > Greg
> >
> > On Aug 3, 2009, at 6:51 PM, Todd Volkert wrote:
> > > Actually, in case you haven't read it yet, the WTKX primer on the
> > > Wiki is a really good resource.  It can be found at
> > > http://cwiki.apache.org/PIVOT/wtkx-primer.html
> > >
> > > Cheers,
> > > -T
> > >
> > > On Mon, Aug 3, 2009 at 6:50 PM, Todd Volkert <tv...@gmail.com>
> > > wrote:
> > > Hi Scott,
> > >
> > > <ImageView image="..." /> translates to ImageView.setImage(String)
> > > (
> http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/Imag
> > >eView.html#setImage(java.lang.String) ), where the string is a resource
> > > name as per
> > > ClassLoader.getResource(String)
> > > (
> http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getReso
> > >urce(java.lang.String) ).
> > >
> > > Thus, the path to your image must be found on your classpath.
> > >
> > > Alternatively, you can prepend the string with "@" and use a
> > > relative path, in which case the value will be converted to a URL
> > > relative to your WTKX file, and Imageview.setImage(URL) will be
> > > called.
> > >
> > > Hope that helps,
> > > -T
> > >
> > >
> > > On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au>
> > > wrote:
> > > Hello,
> > >
> > > I am up to the part of the tutorial:
> > > http://cwiki.apache.org/PIVOT/labels- image-views.html and am doing
> > > something wrong but can't figure it out.
> > >
> > > Instead of just using the tutorial code as is I like to change
> > > things slightly
> > > so that I get a better feel for the toolkit. So I changed the
> > > location of the
> > > clock.png file but I get a "Null Image Alert" from the following code:
> > >
> > > <Window title="Labels" maximized="true"
> > >    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
> > > xmlns="pivot.wtk">
> > >    <content>
> > >        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
> > >            <ImageView image="/home/scott/devel/src/clock.png"
> > > cursor="crosshair"/>
> > >            <Label text="What time is it?"/>
> > >        </FlowPane>
> > >    </content>
> > > </Window>
> > >
> > > The file does exist in that location as I can take the path and
> > > paste it into a
> > > graphics editor. Any help appreciated.
> > >
> > > Cheers,
> > >
> > > Scott.
>
>

Re: Tutorial Runtime Error

Posted by Greg Brown <gk...@mac.com>.
Ah. That's probably because the deploy target runs the clean target,  
which deletes the docs. Maybe deploy should also run the doc target  
(or not run clean beforehand). For now, you can just re-run the doc  
target to get the Javadoc back.
G

On Aug 3, 2009, at 11:18 PM, Scott Lanham wrote:

> The code from SVN built okay but when I ran the deploy target the  
> API docs
> went missing.
>
> On Tue, 4 Aug 2009 09:26:45 am Greg Brown wrote:
>> As Todd mentioned earlier, you may be better off working through the
>> tutorials from SVN. Quite a few things have changed between 1.2 and
>> 1.3, particularly in the area of WTKX.
>>
>> I'd recommend that you get the latest source and run the deploy
>> target, since that will build the latest version of the tutorial apps
>> and documentation. However, if you just want to read the WTKX Primer,
>> you can get it here:
>>
>> http://svn.apache.org/repos/asf/incubator/pivot/trunk/tutorials/www/wtkx_pr
>> imer.template.html
>>
>> Greg
>>
>> On Aug 3, 2009, at 6:51 PM, Todd Volkert wrote:
>>> Actually, in case you haven't read it yet, the WTKX primer on the
>>> Wiki is a really good resource.  It can be found at
>>> http://cwiki.apache.org/PIVOT/wtkx-primer.html
>>>
>>> Cheers,
>>> -T
>>>
>>> On Mon, Aug 3, 2009 at 6:50 PM, Todd Volkert <tv...@gmail.com>
>>> wrote:
>>> Hi Scott,
>>>
>>> <ImageView image="..." /> translates to ImageView.setImage(String)
>>> (http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/Imag
>>> eView.html#setImage(java.lang.String) ), where the string is a  
>>> resource
>>> name as per
>>> ClassLoader.getResource(String)
>>> (http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getReso
>>> urce(java.lang.String) ).
>>>
>>> Thus, the path to your image must be found on your classpath.
>>>
>>> Alternatively, you can prepend the string with "@" and use a
>>> relative path, in which case the value will be converted to a URL
>>> relative to your WTKX file, and Imageview.setImage(URL) will be
>>> called.
>>>
>>> Hope that helps,
>>> -T
>>>
>>>
>>> On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au>
>>> wrote:
>>> Hello,
>>>
>>> I am up to the part of the tutorial:
>>> http://cwiki.apache.org/PIVOT/labels- image-views.html and am doing
>>> something wrong but can't figure it out.
>>>
>>> Instead of just using the tutorial code as is I like to change
>>> things slightly
>>> so that I get a better feel for the toolkit. So I changed the
>>> location of the
>>> clock.png file but I get a "Null Image Alert" from the following  
>>> code:
>>>
>>> <Window title="Labels" maximized="true"
>>>   xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
>>> xmlns="pivot.wtk">
>>>   <content>
>>>       <FlowPane styles="{padding:4, verticalAlignment:'center'}">
>>>           <ImageView image="/home/scott/devel/src/clock.png"
>>> cursor="crosshair"/>
>>>           <Label text="What time is it?"/>
>>>       </FlowPane>
>>>   </content>
>>> </Window>
>>>
>>> The file does exist in that location as I can take the path and
>>> paste it into a
>>> graphics editor. Any help appreciated.
>>>
>>> Cheers,
>>>
>>> Scott.
>


Re: Tutorial Runtime Error

Posted by Scott Lanham <li...@sael.com.au>.
The code from SVN built okay but when I ran the deploy target the API docs 
went missing.

On Tue, 4 Aug 2009 09:26:45 am Greg Brown wrote:
> As Todd mentioned earlier, you may be better off working through the
> tutorials from SVN. Quite a few things have changed between 1.2 and
> 1.3, particularly in the area of WTKX.
>
> I'd recommend that you get the latest source and run the deploy
> target, since that will build the latest version of the tutorial apps
> and documentation. However, if you just want to read the WTKX Primer,
> you can get it here:
>
> http://svn.apache.org/repos/asf/incubator/pivot/trunk/tutorials/www/wtkx_pr
>imer.template.html
>
> Greg
>
> On Aug 3, 2009, at 6:51 PM, Todd Volkert wrote:
> > Actually, in case you haven't read it yet, the WTKX primer on the
> > Wiki is a really good resource.  It can be found at
> > http://cwiki.apache.org/PIVOT/wtkx-primer.html
> >
> > Cheers,
> > -T
> >
> > On Mon, Aug 3, 2009 at 6:50 PM, Todd Volkert <tv...@gmail.com>
> > wrote:
> > Hi Scott,
> >
> > <ImageView image="..." /> translates to ImageView.setImage(String)
> > (http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/Imag
> >eView.html#setImage(java.lang.String) ), where the string is a resource
> > name as per
> > ClassLoader.getResource(String)
> > (http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getReso
> >urce(java.lang.String) ).
> >
> > Thus, the path to your image must be found on your classpath.
> >
> > Alternatively, you can prepend the string with "@" and use a
> > relative path, in which case the value will be converted to a URL
> > relative to your WTKX file, and Imageview.setImage(URL) will be
> > called.
> >
> > Hope that helps,
> > -T
> >
> >
> > On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au>
> > wrote:
> > Hello,
> >
> > I am up to the part of the tutorial:
> > http://cwiki.apache.org/PIVOT/labels- image-views.html and am doing
> > something wrong but can't figure it out.
> >
> > Instead of just using the tutorial code as is I like to change
> > things slightly
> > so that I get a better feel for the toolkit. So I changed the
> > location of the
> > clock.png file but I get a "Null Image Alert" from the following code:
> >
> > <Window title="Labels" maximized="true"
> >    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
> > xmlns="pivot.wtk">
> >    <content>
> >        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
> >            <ImageView image="/home/scott/devel/src/clock.png"
> > cursor="crosshair"/>
> >            <Label text="What time is it?"/>
> >        </FlowPane>
> >    </content>
> > </Window>
> >
> > The file does exist in that location as I can take the path and
> > paste it into a
> > graphics editor. Any help appreciated.
> >
> > Cheers,
> >
> > Scott.


Re: Tutorial Runtime Error

Posted by Greg Brown <gk...@mac.com>.
As Todd mentioned earlier, you may be better off working through the  
tutorials from SVN. Quite a few things have changed between 1.2 and  
1.3, particularly in the area of WTKX.

I'd recommend that you get the latest source and run the deploy  
target, since that will build the latest version of the tutorial apps  
and documentation. However, if you just want to read the WTKX Primer,  
you can get it here:

http://svn.apache.org/repos/asf/incubator/pivot/trunk/tutorials/www/wtkx_primer.template.html

Greg


On Aug 3, 2009, at 6:51 PM, Todd Volkert wrote:

> Actually, in case you haven't read it yet, the WTKX primer on the  
> Wiki is a really good resource.  It can be found at http://cwiki.apache.org/PIVOT/wtkx-primer.html
>
> Cheers,
> -T
>
> On Mon, Aug 3, 2009 at 6:50 PM, Todd Volkert <tv...@gmail.com>  
> wrote:
> Hi Scott,
>
> <ImageView image="..." /> translates to ImageView.setImage(String) (http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/ImageView.html#setImage(java.lang.String) 
> ), where the string is a resource name as per  
> ClassLoader.getResource(String) (http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String) 
> ).
>
> Thus, the path to your image must be found on your classpath.
>
> Alternatively, you can prepend the string with "@" and use a  
> relative path, in which case the value will be converted to a URL  
> relative to your WTKX file, and Imageview.setImage(URL) will be  
> called.
>
> Hope that helps,
> -T
>
>
> On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au>  
> wrote:
> Hello,
>
> I am up to the part of the tutorial: http://cwiki.apache.org/PIVOT/labels-
> image-views.html and am doing something wrong but can't figure it out.
>
> Instead of just using the tutorial code as is I like to change  
> things slightly
> so that I get a better feel for the toolkit. So I changed the  
> location of the
> clock.png file but I get a "Null Image Alert" from the following code:
>
> <Window title="Labels" maximized="true"
>    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"  
> xmlns="pivot.wtk">
>    <content>
>        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
>            <ImageView image="/home/scott/devel/src/clock.png"
> cursor="crosshair"/>
>            <Label text="What time is it?"/>
>        </FlowPane>
>    </content>
> </Window>
>
> The file does exist in that location as I can take the path and  
> paste it into a
> graphics editor. Any help appreciated.
>
> Cheers,
>
> Scott.
>
>


Re: Tutorial Runtime Error

Posted by Todd Volkert <tv...@gmail.com>.
Actually, in case you haven't read it yet, the WTKX primer on the Wiki is a
really good resource.  It can be found at
http://cwiki.apache.org/PIVOT/wtkx-primer.html
Cheers,
-T

On Mon, Aug 3, 2009 at 6:50 PM, Todd Volkert <tv...@gmail.com> wrote:

> Hi Scott,
> <ImageView image="..." /> translates to ImageView.setImage(String) (
> http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/ImageView.html#setImage(java.lang.String)),
> where the string is a resource name as per ClassLoader.getResource(String) (
> http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)
> ).
>
> Thus, the path to your image must be found on your classpath.
>
> Alternatively, you can prepend the string with "@" and use a relative path,
> in which case the value will be converted to a URL relative to your WTKX
> file, and Imageview.setImage(URL) will be called.
>
> Hope that helps,
> -T
>
>
> On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au> wrote:
>
>> Hello,
>>
>> I am up to the part of the tutorial:
>> http://cwiki.apache.org/PIVOT/labels-
>> image-views.html<http://cwiki.apache.org/PIVOT/labels-%0Aimage-views.html>and am doing something wrong but can't figure it out.
>>
>> Instead of just using the tutorial code as is I like to change things
>> slightly
>> so that I get a better feel for the toolkit. So I changed the location of
>> the
>> clock.png file but I get a "Null Image Alert" from the following code:
>>
>> <Window title="Labels" maximized="true"
>>    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
>> xmlns="pivot.wtk">
>>    <content>
>>        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
>>            <ImageView image="/home/scott/devel/src/clock.png"
>> cursor="crosshair"/>
>>            <Label text="What time is it?"/>
>>        </FlowPane>
>>    </content>
>> </Window>
>>
>> The file does exist in that location as I can take the path and paste it
>> into a
>> graphics editor. Any help appreciated.
>>
>> Cheers,
>>
>> Scott.
>>
>
>

Re: Tutorial Runtime Error

Posted by Todd Volkert <tv...@gmail.com>.
Hi Scott,
<ImageView image="..." /> translates to ImageView.setImage(String) (
http://incubator.apache.org/pivot/1.3/docs/api/org/apache/pivot/wtk/ImageView.html#setImage(java.lang.String)),
where the string is a resource name as per ClassLoader.getResource(String) (
http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)
).

Thus, the path to your image must be found on your classpath.

Alternatively, you can prepend the string with "@" and use a relative path,
in which case the value will be converted to a URL relative to your WTKX
file, and Imageview.setImage(URL) will be called.

Hope that helps,
-T

On Mon, Aug 3, 2009 at 6:40 PM, Scott Lanham <li...@sael.com.au> wrote:

> Hello,
>
> I am up to the part of the tutorial: http://cwiki.apache.org/PIVOT/labels-
> image-views.html and am doing something wrong but can't figure it out.
>
> Instead of just using the tutorial code as is I like to change things
> slightly
> so that I get a better feel for the toolkit. So I changed the location of
> the
> clock.png file but I get a "Null Image Alert" from the following code:
>
> <Window title="Labels" maximized="true"
>    xmlns:wtkx="http://incubator.apache.org/pivot/wtkx/1.1"
> xmlns="pivot.wtk">
>    <content>
>        <FlowPane styles="{padding:4, verticalAlignment:'center'}">
>            <ImageView image="/home/scott/devel/src/clock.png"
> cursor="crosshair"/>
>            <Label text="What time is it?"/>
>        </FlowPane>
>    </content>
> </Window>
>
> The file does exist in that location as I can take the path and paste it
> into a
> graphics editor. Any help appreciated.
>
> Cheers,
>
> Scott.
>