« Return to Thread: swingbuilder - linking actions to events
Hi all,
How do I attach a Action to one of the many events swing has besides the
obvious ones that are referred to by "action" in swingbuilder?
I figured out (by guessing) one way below but my syntax "windowClosing:
exit.closure" seems a little odd. I wanted to make sure there isn't another
syntax.
def exit= builder.action(
name:'Exit', closure: {System.exit(0)}
)
def frame=
builder.frame(
title:'Catalog',
windowClosing: exit.closure,
size: [screenWidth -50, screenHeight -50],
location: [19,4],
show: true,
)
{
menuBar() {
menu(text: "File", mnemonic: 'F') {
menuItem(text: "Exit", mnemonic: 'X', action: exit )
}
}
}
Thanks!
Glen
--
View this message in context: http://www.nabble.com/swingbuilder---linking-actions-to-events-tp24238420p24238420.html
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
« Return to Thread: swingbuilder - linking actions to events
| Free embeddable forum powered by Nabble | Forum Help |