diff options
Diffstat (limited to 'src/swing')
-rwxr-xr-x | src/swing/scala/swing/test/ButtonApp.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/swing/scala/swing/test/ButtonApp.scala b/src/swing/scala/swing/test/ButtonApp.scala new file mode 100755 index 0000000000..c6f3e5ec94 --- /dev/null +++ b/src/swing/scala/swing/test/ButtonApp.scala @@ -0,0 +1,18 @@ +import swing._, swing.event._ + +object MyApp extends SimpleGUIApplication { + def top = new Frame { + title = "My Frame" + contents = new GridPanel(2, 2) { + hGap = 3 + vGap = 3 + contents += new Button { + text = "Press Me!" + reactions += { + case ButtonClicked(_) => text = "Hello Scala" + } + } + } + size = (300, 80) + } +} |