Created
July 25, 2011 04:04
-
-
Save fumokmm/1103544 to your computer and use it in GitHub Desktop.
printlnswing.groovy
This file contains hidden or 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
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