Skip to content

Commit c0c2764

Browse files
committed
implemented swing.edt for showtextmessage
1 parent fafb191 commit c0c2764

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

Tutorial-o-Matic/src/main/groovy/ToM_ui.groovy

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,25 @@ class ToM_ui{
7575
)
7676

7777
def static showTextMessage(msg, lapseTime){
78-
def win = swing.dialog(
79-
undecorated : true,
80-
modal : false,
81-
owner : ui.frame,
82-
locationRelativeTo : ui.frame,
83-
location : [(ui.frame.location.x + 100) as int, (ui.frame.location.y + ui.frame.height - 150) as int],
84-
//defaultCloseOperation: JFrame.DO_NOTHING_ON_CLOSE,
85-
background : new Color (240, 240, 240, 150),
86-
pack : true
87-
){
88-
label(
89-
text : msg,
90-
font : new Font("Agency FB", Font.BOLD, 48),
91-
foreground : Color.blue,
92-
border : new EmptyBorder(0, 15, 10, 15),
93-
)
78+
def win
79+
swing.edt{
80+
win = dialog(
81+
undecorated : true,
82+
modal : false,
83+
owner : ui.frame,
84+
locationRelativeTo : ui.frame,
85+
location : [(ui.frame.location.x + 100) as int, (ui.frame.location.y + ui.frame.height - 150) as int],
86+
//defaultCloseOperation: JFrame.DO_NOTHING_ON_CLOSE,
87+
background : new Color (240, 240, 240, 150),
88+
pack : true
89+
){
90+
label(
91+
text : msg,
92+
font : new Font("Agency FB", Font.BOLD, 48),
93+
foreground : Color.blue,
94+
border : new EmptyBorder(0, 15, 10, 15),
95+
)
96+
}
9497
}
9598
def timer = new Timer()
9699
timer.runAfter(lapseTime){

0 commit comments

Comments
 (0)