I want to know how to display math formula in a label for exemple in JavaFX. Like this picture : I want the .jar of a library and a small example in JavaFX. I already found some libraries but they are only for Swing/AWT. I tried some of them, but they don't work for me.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Since
JLaTeXMath
is using theGraphics2D
API for rendering, you can use FXGraphics2D to draw the output to a JavaFXCanvas
. For sample code, please refer to my answer to another similar question https://stackoverflow.com/a/25037747/2592874Just a copy from my answer to https://stackoverflow.com/a/25037747/2592874
The next coming versions of JavaFX support MathML :
Just use a WebView control and MathML and set HTML Content with :
Follow the link JavaFX / OpenJFX Download to reach JavaFX version 11 and beyond. Follow the link Java Early Access Download to reach the early access to these versions.
I looked at JLatexMath, mentioned in your referenced answer, and it can genereate a BufferedImage. With SwingFXUtils you can convert it to a JavaFX Image and use it in your application.
The same approach might work for one of the other libraries.