Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Show SVG-Image in WebView (JavaFX 8)

2680951May 27 2014

Hi,


I want to show a HTML-Page which contains an svg-image and a png image within the webview. I'm using Java1.8.0_05.
I load the page with

webEngine.load(getClass().getResource("index.html").toExternalForm());

The index.html contains

<html>
....

        <img src="Svg_example_square.svg" height="150" width="150" />

       <img src="Png_example_square.png" height="150" width="150" />
...

This is fine while developing - both images are displayed.

But after deploying and starting the application-jar, the svg image is not displayed anymore, while the png-image is still displayed.

Both images are within the jar, at the same place, so I don't understand why the png-image is displayed and the svg-image not.


I can't understand that...  what I'm doing wrong?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 24 2014
Added on May 27 2014
0 comments
1,980 views