Skip to content

Instantly share code, notes, and snippets.

@lyhcode
Created November 17, 2011 08:58
Show Gist options
  • Save lyhcode/1372738 to your computer and use it in GitHub Desktop.
Save lyhcode/1372738 to your computer and use it in GitHub Desktop.
Small Java Code Editor in Groovy + SwingBuilder
@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