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.
JLaTeXMath is using the
Graphics2D API for rendering, you can use FXGraphics2D to draw the output to a JavaFX
Canvas. For sample code, please refer to my answer to another similar question https://stackoverflow.com/a/25037747/2592874
Just 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 :
<math display="block"> <mrow> <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mo>−</mo> <mi>b </mi> <mo>±</mo> <msqrt> <mrow> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>−</mo> <mn>4</mn> <mi>a</mi> <mi>c</mi> </mrow> </msqrt> </mrow> <mrow> <mn>2</mn> <mi>a</mi> </mrow> </mfrac> </mrow> </math>