开发者

How to display Math Symbol in JLabel

开发者 https://www.devze.com 2023-01-19 16:16 出处:网络
I want to display like example 1e10 to 10^10 in JLabel, the ^10 become开发者_运维知识库 small size. To display a label with xy:

I want to display like example 1e10 to 10^10 in JLabel, the ^10 become开发者_运维知识库 small size.


To display a label with xy:

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


You won't be able to do that just by using JLabel (assuming you don't want to put an image inside your JLabel).


If it is really necessary you could write a custom Swing control... which would consist of several JLabels I guess.

0

精彩评论

暂无评论...
验证码 换一张
取 消