You can just use the syntax I mentioned below to change the color of a Label in 
a Form.

I don't think there are any examples dedicated to ImageView, but it is pretty 
straightforward to use. The easiest way to use it would be to pass the URL of 
the image you want to load to ImageView#setImage(URL). If the image is stored 
in your JAR file, you probably want to load it synchronously. However, if it is 
remote, you may want to have the ImageView load it asynchronously, by calling 
ImageView#setAsynchronous(true) before calling setImage(URL).

Hope this helps.


On Apr 19, 2010, at 5:18 PM, Shahzad Bhatti wrote:

> I am using a set of labels along with Form similar to stock details in the 
> stock-tracker example. I would like to display "change value" of the stock in 
> green or red color along. For example, in the stock tracker example, the 
> table renderer uses custom renderer to show change value in different color 
> and I need to do the same thing in the labels that is loaded by the form. 
> Also, do you have any examples to use image as well. Thanks.
> 
> 
> 
> On 4/19/10 2:02 PM, "Greg Brown" <[email protected]> wrote:
> 
> Not quite sure what you are looking for. Are you trying to write a table, 
> tree, or button renderer, or are you just trying to change the color/icon of 
> a Label?
> 
> To change the color of a label, you can just set the "color" style:
> 
>  label.getStyles().put("color", "#ffffff");
> 
> Unlike Swing JLabels, Pivot Labels don't combine a text label and an icon - 
> they only display text. To create the equivalent of a Swing JLabel, you can 
> use a BoxPane that contains an ImageView and a Label.
> 
> 
> On Apr 19, 2010, at 4:53 PM, Shahzad Bhatti wrote:
> 
>> I need to modify color and an icon for a label based on its value. I saw 
>> example code that uses renderer for tables, trees and buttons but can 
>> someone suggest the best way to write renderer  for label to that.  Thanks.
>> 
>> ______________________________________________
>> 
>> See  http://www.peak6.com/email_disclaimer.php
>> for terms and conditions related to this email
> 
> 

Reply via email to