1

After searching about this i found two interesting answers:

  1. Native image formats support for javaFX

  2. controlling gif image with javaFX

but as i see javaFX doesn't support APNG images.How to solve this problem with any external library or write some code.I need a solution on that...

Example Image:
enter image description here

Thanks for help.

Community
  • 1
  • 1
GOXR3PLUS
  • 6,877
  • 9
  • 44
  • 93

1 Answers1

1

There is no apng support in JavaFX 8.

Use a 3rd party library to decode the apng, extract the frames and metadata from it, then convert those to JavaFX images and play them back using JavaFX's animation support:

  1. Google apng decoder java.
  2. Choose a Java library that decodes the apng format.
  3. Apply the same solution Roland demonstrates in: How I can stop an animated GIF in JavaFX?

Or pre-convert the apng files to gifs:

  1. Google apng to gif converter.
  2. Choose any utility that converts apngs to gifs.
  3. Convert all the apngs used by your application to gifs.
  4. In your JavaFX application use the converted gifs rather than apngs.
Community
  • 1
  • 1
jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • Thanks for help!Something other i want to ask is how can i add on javaFX tab a progressIndicator in the place of Label graphic icon.How it can be done?How i can modify the Label of the javaFX tabPane in this way? – GOXR3PLUS Apr 20 '16 at 21:45
  • 1
    You can set a [graphic on tabs](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Tab.html#graphicProperty). A graphic is a node so it could be a progress indicator. If this is not clear enough, then create a new question that includes an [mcve](http://stackoverflow.com/help/mcve) that demonstrates the issue. – jewelsea Apr 20 '16 at 23:09