diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2011-12-07 21:52:20 +0100 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2011-12-07 22:09:04 +0100 |
commit | f3e7e98cc0f47eacb59400b2c56c6bd2cb8b2ebc (patch) | |
tree | 6d77a6dbbb3de69bc38a7e2d55a37596960675a0 /docs/examples/swing/SwingApp.scala | |
parent | 332fec96e31840878bed41dd7b5314b97d8da7c2 (diff) | |
download | scala-f3e7e98cc0f47eacb59400b2c56c6bd2cb8b2ebc.tar.gz scala-f3e7e98cc0f47eacb59400b2c56c6bd2cb8b2ebc.tar.bz2 scala-f3e7e98cc0f47eacb59400b2c56c6bd2cb8b2ebc.zip |
Clean up standard/swing library by deprecating/moving code examples
Deprecate scala/xml/include/sax/Main.scala.
Move scala/swing/test/* to docs/examples.
Saves 160KB in scala-swing.jar.
Fixes SI-4627.
Diffstat (limited to 'docs/examples/swing/SwingApp.scala')
-rw-r--r-- | docs/examples/swing/SwingApp.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/examples/swing/SwingApp.scala b/docs/examples/swing/SwingApp.scala new file mode 100644 index 0000000000..b3fe7447ef --- /dev/null +++ b/docs/examples/swing/SwingApp.scala @@ -0,0 +1,29 @@ +package examples.swing + +import swing._ +import swing.event._ + +object SwingApp extends SimpleSwingApplication { + def top = new MainFrame { + title = "SwingApp" + var numclicks = 0 + object label extends Label { + val prefix = "Number of button clicks: " + text = prefix + "0 " + listenTo(button) + reactions += { + case ButtonClicked(button) => + numclicks = numclicks + 1 + text = prefix + numclicks + } + } + object button extends Button { + text = "I am a button" + } + contents = new FlowPanel { + contents.append(button, label) + border = Swing.EmptyBorder(5, 5, 5, 5) + } + } +} + |