简体   繁体   中英

How to display Math Symbol in JLabel

我想在JLabel中显示示例1e10到10 ^ 10,^ 10变得很小。

要显示带有x y的标签:

JLabel l = new JLabel ("<html>x<sup>y</sup></html>"); 

您不能仅通过使用JLabel来做到这一点(假设您不想在JLabel中放置图像)。

如果确实有必要,您可以编写一个自定义的Swing控件...我猜它应该包含几个JLabel。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM