java - 可以着色和突出显示的 swing 文本编辑器

标签 java swing text-editor

我正在编写一个应用程序,用户需要编写一个 javascript 脚本作为输入,现在我有一个简单的 JTextArea,但我想用一些东西来改变它,它会做一些突出显示和代码着色以使脚本更相干。

你知道有什么开源软件可以做到这一点吗?

谢谢

最佳答案

RSyntaxTextArea

RSyntaxTextArea is a syntax highlighting text component for Java Swing. It extends JTextComponent so it integrates completely with the standard javax.swing.text package. It is fast and efficient, and can be used in any application that needs to edit or view source code.

RSyntaxTextArea was originally part of the RText programmer's text editor, but is currently being made into a separate component, reusable in any Swing application.

截图:

enter image description here

关于java - 可以着色和突出显示的 swing 文本编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2020796/

相关文章:

java - 如何在 Windows 10 的 Java Swing JButton 中获得白色背景

linux - 有谁知道如何在 Visual Studio Code 中重置 gitlens 扩展的身份验证

java - Nimbus LAF 的 Mac 键盘快捷键

java - 如何撤消 JSpinner 上的更改?

java - Eclipse Memory Analyzer - Leak Suspects Report 没有指向我的类 - 为什么?

java - 在语句中的查询生成器中传递一个数组

Java 单选按钮清除/取消选择

visual-studio - VS设置: “Follow project coding conventions” do?是什么意思

grep - 使用 Notepad++ ,如果 "Find All"字符串在 1 行中匹配多次,则输出显示重复行

java - Jpeg DCT 和 IDCT 计算不正确