Created
November 17, 2011 08:58
-
-
Save lyhcode/1372738 to your computer and use it in GitHub Desktop.
Small Java Code Editor in Groovy + SwingBuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group='net.sf.jedit-syntax', module='jedit-syntax', version='2.2.2') | |
import org.syntax.jedit.JEditTextArea | |
import org.syntax.jedit.tokenmarker.* | |
import groovy.swing.SwingBuilder | |
def mpanel | |
def editor | |
new SwingBuilder().edt { | |
frame(title:'Editor', pack: true, show: true, locationRelativeTo: null) { | |
borderLayout() | |
lookAndFeel('system') | |
mpanel = panel () | |
mpanel.add(editor = new JEditTextArea()) | |
editor.setTokenMarker(new JavaTokenMarker()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment