- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试此处找到的 RSyntaxTextArea 示例
http://fifesoft.com/rsyntaxtextarea/examples/example1.php
import java.awt.*;
import javax.swing.*;
import org.fife.ui.rtextarea.*;
import org.fife.ui.rsyntaxtextarea.*;
/**
* A simple example showing how to use RSyntaxTextArea to add Java syntax
* highlighting to a Swing application.<p>
*
* This example uses RSyntaxTextArea 2.0.1.<p>
*
* Project Home: http://fifesoft.com/rsyntaxtextarea<br>
* Downloads: https://sourceforge.net/projects/rsyntaxtextarea
*/
public class TextEditorDemo extends JFrame {
private static final long serialVersionUID = 1L;
public TextEditorDemo() {
JPanel cp = new JPanel(new BorderLayout());
RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
textArea.setCodeFoldingEnabled(true);
textArea.setAntiAliasingEnabled(true);
RTextScrollPane sp = new RTextScrollPane(textArea);
sp.setFoldIndicatorEnabled(true);
cp.add(sp);
setContentPane(cp);
setTitle("Text Editor Demo");
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setLocationRelativeTo(null);
}
public static void main(String[] args) {
// Start all Swing applications on the EDT.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new TextEditorDemo().setVisible(true);
}
});
}
}
抛出此异常
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaUI.<clinit>(RSyntaxTextAreaUI.java:37)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.createRTextAreaUI(RSyntaxTextArea.java:723)
at org.fife.ui.rtextarea.RTextAreaBase.init(RTextAreaBase.java:630)
at org.fife.ui.rtextarea.RTextArea.init(RTextArea.java:854)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.init(RSyntaxTextArea.java:1784)
at org.fife.ui.rtextarea.RTextAreaBase.<init>(RTextAreaBase.java:117)
at org.fife.ui.rtextarea.RTextArea.<init>(RTextArea.java:215)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.<init>(RSyntaxTextArea.java:363)
at TextEditorDemo.<init>(TextEditorDemo.java:24)
at TextEditorDemo$1.run(TextEditorDemo.java:44)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.fife.ui.rsyntaxtextarea.RSyntaxTextArea, locale sv_SE
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaEditorKit.<clinit>(RSyntaxTextAreaEditorKit.java:76)
... 24 more
Caused by: java.lang.ClassCastException: org.fife.ui.rsyntaxtextarea.RSyntaxTextArea cannot be cast to ResourceBundle
at java.util.ResourceBundle$Control.newBundle(Unknown Source)
at java.util.ResourceBundle.loadBundle(Unknown Source)
at java.util.ResourceBundle.findBundle(Unknown Source)
at java.util.ResourceBundle.findBundle(Unknown Source)
at java.util.ResourceBundle.findBundle(Unknown Source)
... 27 more
这里出了什么问题,有什么想法可以解决这个问题吗?
谢谢!
最佳答案
已经找到问题的解决方案
我没有将 RSyntaxTextArea 的源代码复制到我的 Eclipse 项目的 src 文件夹中,而是使用 ANT 构建 rsyntaxtextarea.jar 文件,并将此 jar 文件包含在我的 Eclipse 项目 java 构建路径中。
关于java - 找不到基本名称 org.fife.ui.rsyntaxtextarea.RSyntaxTextArea、区域设置 sv_SE 的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21216413/
我正在尝试此处找到的 RSyntaxTextArea 示例 http://fifesoft.com/rsyntaxtextarea/examples/example1.php import java.
我正在使用 RSyntaxTextArea 作为我正在使用的最小化 IDE,除了行号之外,一切似乎都非常顺利,我无法真正显示它: RSyntaxTextArea tex
我正在创建一个编辑器,为此我使用了 RSyntaxTextArea。我想要一些自定义关键字并自动完成它。 有没有简单的方法可以做到这一点,或者其他一些可以轻松实现的库。 最佳答案 创建一个具有 Def
我需要将 RSyntaxTextArea 导入到我的项目中,但我似乎无法让它工作! 主页位于:http://fifesoft.com/rsyntaxtextarea/下载:http://sourcef
我知道我的问题不太清楚,但我会尝试在这里解释一下:在我的 java 应用程序中,我使用 RSyntaxTextArea 库。当我尝试编写由一些数字后跟字母组成的字符串(即 2c、7x、12g)时,该字
我正在开发一个java代码编辑器,它将用于并行计算和分布式计算。我正在寻找 Javafx 中 RSyntaxTextArea 的替代方案,因为我尝试在 Javafx 中实现它,但它工作得不好,就像有时
我编写了一个调用 RSyntaxTextArea 和自动完成的代码。当用户输入 function 时,单词将被替换为 function<>。我想在下面的代码中突出显示“标签”一词,以便用户知道他们必须
我在将来自文本区域的按键事件到达 JMenBar 时遇到问题。我在运行时从 XML 文件生成了菜单栏,并且文本区域的创建方式如下: @Override public void createUI() {
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker类的一些代码示例,展示了YamlTokenMaker类的具体用法。这些代码示例主要来
本文整理了Java中org.fife.ui.rsyntaxtextarea.folding.YamlFoldParser类的一些代码示例,展示了YamlFoldParser类的具体用法。这些代码示例主
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.zzUnpackAction()方法的一些代码示例,展示了YamlTokenMak
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.zzRefill()方法的一些代码示例,展示了YamlTokenMaker.zzR
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.zzUnpackTrans()方法的一些代码示例,展示了YamlTokenMake
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.yybegin()方法的一些代码示例,展示了YamlTokenMaker.yybe
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.zzScanError()方法的一些代码示例,展示了YamlTokenMaker.
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.yylex()方法的一些代码示例,展示了YamlTokenMaker.yylex(
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.zzUnpackAttribute()方法的一些代码示例,展示了YamlToken
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.resetTokenList()方法的一些代码示例,展示了YamlTokenMak
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.yylength()方法的一些代码示例,展示了YamlTokenMaker.yyl
本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.yyreset()方法的一些代码示例,展示了YamlTokenMaker.yyre
我是一名优秀的程序员,十分优秀!