- Syntax highlighting for over 30 programming languages
- Code folding
- Code completion (Addon library, work in progress)
- Find/Replace with standard options (regex, match case, etc.).
- Loading and saving of local or remote files (via FTP).
- User-defined macros
- Code templates
- Unlimited undo/redo
- Drag and drop
- Edit with multiple fonts simultaneously
- Bracket matching
- Current line highlighting
- Clickable hyperlinks (only certain languages)
- Try the applet demo.
- Download the latest stable release at its SourceForge page.
- Browse the Javadoc.
- View the source code online.
- Check out a copy from the Subversion repository.
- Peruse the examples and tutorials page. Eclipse project source code is included for the examples. Please be aware that this is a work in progress, and we're adding to it whenever we can!
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.
Requires Java 1.4 or greater.
A forum is now available for questions, comments and feedback. Bug reports should probably go to the project's SourceForge page.
Downloads can be found on SourceForge, or you can grab the bleeding edge from the Subversion repository.
It is available under a modified BSD license.
For a simple example of using RSyntaxTextArea in a Java application, look here.Note: Often I forget to update this section. If you're checking it, it's probably better to just keep an eye on our blog to stay up to date on RSyntaxTextArea!
05/05/2012:
- Version 2.0.3 of RSyntaxTextArea was just released. This release adds syntax highlighting and code folding for LaTeX, syntax highlighting for DTD files, fixed a bug when using RSTA in NetBeans' visual editor, and a couple of other bug fixes.
03/14/2012:
- Version 2.0.2 of RSyntaxTextArea was just released. This fixes all bugs found in 2.0.1 and adds a couple of minor new features.
02/19/2012:
- Version 2.0.1 of RSyntaxTextArea was just released. This is a maintenance release, fixing the minor issues found in 2.0.0.
02/13/2012:
- Version 2.0.0 of RSyntaxTextArea has been released at
SourceForge!
The major changes in 2.0 include:
- Code folding added for C, C++, C#, CSS, Groovy, Java, JavaScript, MXML, Perl, and XML.
- Support for theming the editor (fonts, colors, etc.) via XML files.
- Enhanced syntax highlighting, especially for web languages including HTML, CSS, JavaScript, JSP, and PHP.
01/15/2012:
- Version 2.0.0-beta2 of RSyntaxTextArea has been released at SourceForge! Here are two blog posts outlining all the new stuff in the 2.0 betas.
08/29/2011:
- Version 1.5.2 of RSyntaxTextArea has been released at SourceForge! Here's a blog post outlining all the cool new stuff.
12/06/2009:
- Version 1.4.0 of RSyntaxTextArea has been released at SourceForge! Check out this blog post to see all of the cool changes!
- The first official release of the spell checker add-on (version 1.4.0, to go along with the new RSTA version) has also been released! Download it and try it out!
- The Examples page has been updated for 1.4.0, and a couple more examples have been added. I hope to be adding even more content to this page in the next couple of weeks to address the questions I'm asked most often.
01/16/2009:
- Version 1.2.2 of RSyntaxTextArea has been released at SourceForge. This is a minor bugfix release that fixes a few issues that were reported from the field. Check it out!
12/29/2008:
- A code completion add-on library has been added to Subversion. While in its early stages, this library still provides an incredible usability boost for people writing IDE's or editors for languages with many keywords, constructs, etc. I hope to have ctags file parsing support integrated into code completion soon.
12/19/2008:
- I wasn't planning on doing another "official" release so quickly, but there have been some important enhancements in the flexibility department lately, so I decided to go ahead and get them out there before the holidays in case I get busy. Version 1.2 is not available on SourceForge. This release also fixes an input bug on Macs using a non-English keyboard layout. Thanks to David at Jalbum for pointing out the issue!
- RSyntaxDocument is no longer hard-coded with what syntax styles it knows about. It now uses a TokenMakerFactory. These factories can be installed on RSyntaxDocuments to change what languages can be syntax highlighted. This helps facilitate adding custom languages, as well as removing built-in languages that are not needed.
- Since syntax styles are no longer hard-coded into the editor, users can remove any *TokenMaker classes from rsyntaxtextarea.jar that they do not use in their application. This makes for a smaller footprint for the library in many use cases.
- More changes in SVN to make the editor more configurable. The popup menu is now modifiable via the createPopupMenu() and sePopupMenu() methods. There is also a configurePopupMenu() method that is called whever the popup is about to be displayed, for context-specific modifications, etc. Note that we don't use the 1.5 context menu API added to JComponent since RSyntaxTextArea also runs on 1.4, but our API is slightly more flexible.
- Code templates can be removed at runtime, not just added.
- The demo jar is now executable, so double-clicking on it in Windows should launch a standalone version of the demo (it used to be just an applet, so downloading it wasn't very useful).
- Version 1.1 has been released! You can download it directly from SourceForge. This release includes all of the changes I've outlined in the past couple of months. I've updated the javadoc to reflext this release.
- Code cleanup.
- Preparation for smart indent.
- Expect a 1.1 release very soon.
- Changing the encoding or line separator of a TextEditorPane now marks the editor as dirty, and listeners are notified.
- RSyntaxTextAreaDemo changes the source being displayed to match the language being displayed (e.g. Perl source is displayed when "Perl" is selected, etc.).
- Other minor cleanup.
- Big changes this time. Don't know how stable SVN is at the moment, but feel free to try it out.
- Added TextEditorPane class. This is basically a wrapper around RSyntaxTextArea that provides functionality needed in virtually all text editors - loading & saving, managing dirty state of editor, etc. Properties are fired to allow for hosting applications to react to these events.
- Remote URL's can be loaded & edited in TextEditorPanes, not just local files. This allows for editing files on another machine via FTP, for example. This functionality is not well tested and is not yet guaranteed to always work.
- Fixed a bug in reading Unicode files if "UTF-16" was the encoding specified to UnicodeReader ("UTF-16LE" and "UTF-16BE" were always fine).
- Improved hyperlink support. URL highlighting now follows URL spec and should now highlight all (?) hyperlinks. C++ also now supports hyperlinks in comments.
- Added initial hyperlink support in SVN. Host applications can add javax.swing.text.HyperlinkListeners to the editor and get notified when the user clicks on a hyperlink (e.g. Ctrl+Click). This is done on a per-syntax basis and currently only C and Java support hyperlinks..
- Added makefile and Ruby syntax highlighting in SVN.
- Removed from RText and made into its own separate project.