JEdi​​torpane与JTextPane [英] JEditorpane vs. JTextPane

查看:68
本文介绍了JEdi​​torpane与JTextPane的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须为我的大学用java swing创建一个项目. Java文件的编辑器,带有适当的文本突出显示,即 java关键字 java注释普通文本使用不同的颜色和字体.
帮助我选择Java提供的两个样式化文本组件 JEditorpane JTextPane 之一,以便我可以完全满足要求.
请告诉我这两者之间的适当区别,在哪种情况下我必须使用其中一种.

i have to create a project in java swing for my college. An editor of java files with proper text highlighting i.e different colors and fonts for java keywords, java comments and for normal text.
Help me to select one of two styled text component JEditorpane and JTextPane provided by java so that i can full-fill the requirements.
Please tell me suitable difference between these two that in which kind of situation i have to use one of these.

推荐答案

您可以使用它们中的任何一个,但是如果它是RTF编辑器,那么我建议您使用JTextPane.

You can use either of them, but if it is a rich text editor then I would suggest using the JTextPane.

您可能还会找到有用的主题.

You may also find this topic useful.

这篇关于JEdi​​torpane与JTextPane的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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