Java Swing组件中的HTML标签 [英] HTML Tag in Java Swing Components

查看:66
本文介绍了Java Swing组件中的HTML标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

向Swing组件(例如JLabels)添加HTML标签是否会使JFrame的渲染变慢?我的意思是Swing组件中HTML呈现的性能如何?

Does adding HTML tags to Swing components, for example JLabels, make rendering of JFrame slow? I mean how is the performance of HTML rendering in Swing components?

推荐答案

是的,具体取决于您的html的复杂程度.

Yes, depending on the complexity of your html.

实际上,当jlabel中包含html时,BasicLabelUI使用

Actually when you have html in your jlabel, the BasicLabelUI uses a View to paint the label instead of simple paint logic. Now you can check various different implementations of View class to check how it affects you.

为清楚起见,您可以阅读BasicLabelUI.paint()的代码.

You can read the code of BasicLabelUI.paint() for clarity.

但是对于装饰简单的html,我根本不需要担心.

But for simple decorated html, I don't think you need to worry at all.

这篇关于Java Swing组件中的HTML标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆