Skip to main content

Not Able to change ImageURL at run time

6 replies [Last post]
vrakesh_techie
Offline
Joined: 2009-03-09

Hi,
In My java Fx Application, i'm using

var url : String = "SomeDefaultImageURL";
var StockGraph = bind ImageView {
x : bind x + 10;
y : bind y + 120;
image: Image {
height: 100;
width: 120;
url: stockurl //message-icon.gif

}
}

At run time, i'm changing the value of the stockurl . But still my changes are not taking effect and the Application is still showing the old image only even after changing it .

Pl. help .

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vrakesh_techie
Offline
Joined: 2009-03-09

Hi,
It worked now .
I'm sorry, earlier there is a small typo mistake in the URL that i have passed to the Appl., so the image is not displayed . Now i corrected it and it worked fine .

Thanks a lot for your time Michael .

Bye

vrakesh_techie
Offline
Joined: 2009-03-09

I have tried binding the Image as well but it DID NOT work .

Thanks

michael_heinrichs
Offline
Joined: 2007-11-15

Interesting, binding the image works for me:

[code]
var StockGraph: ImageView = ImageView {
x: bind x + 10;
y: bind y + 120;
image: bind Image {
height: 100;
width: 120;
url: stockurl //message-icon.gif
}
}
[/code]

vrakesh_techie
Offline
Joined: 2009-03-09

Hi Michael,
Thanks for your Reply . But Java Fx will not allow you to bind using
url: bind stockurl .
It will throw an exception stating that "URL has script only ( default ) bind access in javafx,scene.Image.image" .

That is the reason why i'm trying to bind the ImageView .

Pl. help .

Thanks

michael_heinrichs
Offline
Joined: 2007-11-15

Right, forgot about that. Try binding the image.

michael_heinrichs
Offline
Joined: 2007-11-15

You need to bind to stockurl:
url: bind stockurl

I don't think you need to bind the ImageView btw.