I was wondering if it was possible to put chemical formulas ( SUB and SUP characters) into a Label content like:
Asked
Active
Viewed 310 times
0
-
http://stackoverflow.com/questions/24973389/display-math-formula-in-javafx – Stefan Jun 10 '15 at 12:25
-
Also http://stackoverflow.com/questions/456002/displaying-fancy-equations-with-java – J Atkin Jun 10 '15 at 13:07
1 Answers
0
Here a solution using jlatexmath:
private void createGraphic(String textValue, Color color) {
TeXFormula tex = new TeXFormula(textValue);
java.awt.Image awtImage = tex.createBufferedImage(TeXConstants.STYLE_TEXT, 12, color, null);
Image fxImage = SwingFXUtils.toFXImage((BufferedImage) awtImage, null);
label.setGraphic(new ImageView(fxImage));
}
-
I've added a link to the mentioned library. Please check if it is really the library you meant. – Tom Jun 10 '15 at 15:26