[英]rsyntaxtextarea component add netbeans
我正在使用rsyntaxtextarea
,我已將它添加到 Netbeans 調色板,這里它有兩個組件,
RSyntaxTextArea 是主要的文本編輯器 class。它擴展了 JTextArea,因此它具有您期望從 Swing 文本組件獲得的所有標准方法,以及更具體的處理語法突出顯示的方法。
RTextScrollPane 是 JScrollPane 的擴展,支持行號。 如果需要,您可以使用標准的 JScrollPane,但在編輯源代碼時,啟用行編號通常會很好。
我實際上可以通過從調色板拖放來添加RSyntaxTextArea
,但我不能為RTextScrollPane
這樣做( RSyntaxTextArea
必須比現有的滾動面板感覺更好)。 錯誤消息說組件無法實例化,你應該確保它是一個 JavaBean
如何通過拖放將這兩個組件添加到 .netbeans 中?
// 嘗試一下;
/**
*
* @author Filipe
*/
public class RTextScrollPaneFlp extends RTextScrollPane {
public RTextScrollPaneFlp() {
super(new RTextEditorSyntaxFlp());
}
}
/**
*
* @author Filipe
*/
public class RTextEditorSyntaxFlp extends RSyntaxTextArea {
public RTextEditorSyntaxFlp() {
super(5, 20);
this.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL);
this.setCodeFoldingEnabled(true);
Color azulClaro = Color.decode("#E0EEEE");
this.setCurrentLineHighlightColor(azulClaro);
}
}
/*Then right click on the class RTextScrollPaneFlp->Tools->Add to palette.
Create a new category or add the default category "beans".
Done, your component will appear in the palette, I hope that helps.
Enjoy yourself!
*/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.