That works. You can also use a URL. The '@' symbol is translated to a URL 
internally by the WTKXSerializer. It allows you to load an image using a path 
that is relative to the current WTKX file.

In Java, you can do something similar using Class#getResource(). For example, 
if the image file is located in the same directory as your class file, you 
could do something like this:

((ButtonData)someButton.getButtonData()).setIcon(getClass().getResource("mysecondimage.png"));

This approach is a little more resilient to refactoring, since it doesn't rely 
on a hard-coded path. 

On May 13, 2010, at 6:20 PM, JohnRodey wrote:

> 
> Scratch that,  I was able to use the full relative path:
> ((ButtonData)someButton.getButtonData()).setIcon("com/my/path/mysecondimage.png");
>  
> -- 
> View this message in context: 
> http://apache-pivot-users.399431.n3.nabble.com/How-to-dynamically-change-pushbutton-icon-tp815958p815983.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Reply via email to