寻找具有文档选择器的 swing(或其他)文本编辑器组件

发布于 2024-10-10 02:21:14 字数 153 浏览 0 评论 0原文

我正在创建一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

老子叫无熙 2024-10-17 02:21:14

没有内置任何东西可以执行此操作,但 JDesktopPane 可能是比 JTabbedPane 更好的选择。

Nothing is built-in to do this, but JDesktopPane might be a better option for selection rather than a JTabbedPane.

听风念你 2024-10-17 02:21:14

对于纯文本,我倾向于 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. The append() method is particularly convenient. The articles Text Area Scrolling and Message Console are also very helpful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文