Skip to content

Instantly share code, notes, and snippets.

@fumokmm
Created July 25, 2011 04:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fumokmm/1103544 to your computer and use it in GitHub Desktop.
Save fumokmm/1103544 to your computer and use it in GitHub Desktop.
printlnswing.groovy
import groovy.swing.SwingBuilder
import javax.swing.JFrame
import java.awt.GridLayout
def printlnswing(message) {
new SwingBuilder().edt {
frame(title: 'Message', pack: true, visible: true,
layout: new GridLayout(0, 1),
defaultCloseOperation: JFrame.EXIT_ON_CLOSE) {
message.eachLine() {
label it
}
}
}
}
printlnswing('Hello!\nWorld')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment