### Initialize RSyntaxTextArea in a Swing Application Source: http://bobbylight.github.io/RSyntaxTextArea Demonstrates the basic setup of an RSyntaxTextArea component within a JFrame, including enabling syntax highlighting for Java and code folding. ```java 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. */ 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); RTextScrollPane sp = new RTextScrollPane(textArea); 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); } }); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.