寻找具有文档选择器的 swing(或其他)文本编辑器组件
我正在创建一个java应用程序,需要显示多个纯文本文档。我一直在使用 JEditorPane (用于每个文档显示文本)和 JTabbedPane (用于文档选择),但我想我更喜欢使用更好的东西(如果存在)。
是否有一个现有的类可以创建一个内置文档选择器功能的极其简单的编辑器?
I am creating a java app that needs to display multiple documents worth of plain text. I have been playing around with JEditorPane (for each document to display text) with JTabbedPane (for document selection) but I think I would prefer to use something better (if it exists).
Is there an existing class that creates a dead simple editor with document selector functionality built in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有内置任何东西可以执行此操作,但 JDesktopPane 可能是比 JTabbedPane 更好的选择。
Nothing is built-in to do this, but JDesktopPane might be a better option for selection rather than a JTabbedPane.
对于纯文本,我倾向于
JTextArea
“显示多行文本并可选择允许用户编辑文本。” 如何使用文本区域。append()
方法特别方便。文章文本区域滚动和消息控制台也非常有帮助。For plain text, I would tend to prefer
JTextArea
"that displays multiple lines of text and optionally allows the user to edit the text." It is described in the article How to Use Text Areas. Theappend()
method is particularly convenient. The articles Text Area Scrolling and Message Console are also very helpful.