JEditorpane与JTextPane [英] JEditorpane vs. 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.
这篇关于JEditorpane与JTextPane的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!