• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

ImageView does not appear because of the url

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I have a problem with an imageview that refuses to load, more precisely with this kind of image :



(it's only bug on this kind of site).

I would like to put it in an imageview and the imageview in an hbox.
On JavaFX 15 it works but I can't create the .jar and run it without bug so I went back to JavaFX that there is on netbeans. This is version 8 if I am not mistaken.

Thanks to the people who will want to help me
 
Bartender
Posts: 242
27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, welcome to the Ranch!

Is there a reason you're referencing an image on an external site (for example does the site change that image and you want the application to change too)? If not, I'd recommend downloading the image and packaging it in your application Resources folder, if you have permission to use the image in your application. That'll avoid any sort of networking issues or stability issues with the website.

Other than that: what problem are you having specifically with it?
 
Maco GaminG
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Zachary Griggs wrote:Hey, welcome to the Ranch!

Is there a reason you're referencing an image on an external site (for example does the site change that image and you want the application to change too)? If not, I'd recommend downloading the image and packaging it in your application Resources folder, if you have permission to use the image in your application. That'll avoid any sort of networking issues or stability issues with the website.

Other than that: what problem are you having specifically with it?







I really need to take the images through URLs and not by storing it in the application, otherwise it will make an application with too much storage volume which will be exhausted on the computer.

The problem is that I can't do it because nothing is displayed. I guess it's due to the link and has a JavaFX bug, that's why I'm asking if anyone has a solution.
 
Marshal
Posts: 28424
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Zachary Griggs wrote:Other than that: what problem are you having specifically with it?



This means that saying "there's a bug" isn't helpful.
 
Maco GaminG
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Zachary Griggs wrote:Other than that: what problem are you having specifically with it?



This means that saying "there's a bug" isn't helpful.





Like I said, the only problem I have is that I can't display the image of this link and I don't understand why.
 
Paul Clapham
Marshal
Posts: 28424
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd go with Zachary's suggestion about downloading the image and storing it locally. If your computer is having problems storing a 19K-byte image then I'm a bit surprised that it can do anything at all. Even if you had 100 images like that there shouldn't be a problem.
 
Zachary Griggs
Bartender
Posts: 242
27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I really need to take the images through URLs and not by storing it in the application, otherwise it will make an application with too much storage volume which will be exhausted on the computer.  



If this is some kind of requirement from a school assignment, that's fine, you have to follow it. But if it's not, I strongly recommend you reconsider. Images are very, very small compared to the amount of storage modern computers have. You can even store videos and music in Java resources (and have to, for applications like video games) without a problem. In fact, downloading from online is really inefficient because not only does that image get stored in memory anyways, it'll have to get downloaded from the Internet, which means establishing a connection, streaming the data over that connection, etc. I don't see a strong reason to do this for this use case.

Now for debugging - try to narrow down the problem
- Do other images show and just this one does not show?
- Does it throw an exception or simply display nothing?
- Try analyzing the ImageView in the Debugger. Does the internal Image show up there, is it an empty image, does it have some invalid state? Is the size all zero or something like that?
reply
    Bookmark Topic Watch Topic
  • New Topic