A text component to edit various kinds of content. You can find how-to information and examples of using editor panes in Using Text Components, a section in The Java Tutorial. This component uses implementations of the EditorKit to accomplish its behavior. It effectively morphs into the proper kind of text editor for the kind of content it is given. The content type that editor is bound to at any given time is determined by the EditorKit currently installed. If the content is set to a new URL, its type is used to determine the EditorKit that should be used to load the content. By default, the following types of content are known: text/plain
Plain text, which is the default the type given isn't recognized. The kit used in this case is an extension of DefaultEditorKit that produces a wrapped plain text view.
text/html
HTML text. The kit used in this case is the class javax.swing.text.html.HTMLEditorKit which provides HTML 3.2 support.
text/rtf
RTF text. The kit used in this case is the class javax.swing.text.rtf.RTFEditorKit which provides a limited support of the Rich Text Format.
Plain text, which is the default the type given isn't recognized. The kit used in this case is an extension of DefaultEditorKit that produces a wrapped plain text view.
text/html
HTML text. The kit used in this case is the class javax.swing.text.html.HTMLEditorKit which provides HTML 3.2 support.
text/rtf
RTF text. The kit used in this case is the class javax.swing.text.rtf.RTFEditorKit which provides a limited support of the Rich Text Format.
解决方案 »
- 菜鸟虚心请教
- 数据库的。。。
- 数据库的时间问题?
- 怎样让Jfilechoose显示指定扩展名的文件?
- 在linux下用JAVA的jni调c++问题
- 请问 谁有<<Java2 核心技术 卷I: 基础知识 (第六版)>> 的示例程序包, 共享一下好吗, 谢谢.
- 解决套打问题,实现诺言,给vssivl(克斯)300分
- 关于java编码的讨论,请高手发言(需要对系统有所了解)!
- Java新手請多關照 !!
- Java源代码打成可执行jar包后连接不上sql2000数据库。在eclipse里能连上。求大神帮助,感谢
- 一个城市高新开发区,信息化建设内容??
- 做了一个程序是将某个网页上的图片下载下来,然后存到数据库中,下载这个图片是不是用urlconnection就行了??
JEditorPane主要功能是展现不同类型文件格式内容
支持三种文件类型: txt , RTF ,HTML(只能支持简单语法)
主要用途:online Help
simple example:
JEditorPane edit=new JEditorPane;
edit.setPage(yourPage);
是用这个类还是用JTextArea 啊 还是有别的更好的做法啊 ?
用JEditorPane应该差不多,,不过,为什么不用JTextPane呢我觉得这个还可以