summaryrefslogtreecommitdiff
path: root/src/actors/scala/actors/gui/GUIApplication.scala
blob: 7d52e75628f109bf107004c55dc64177fdac93be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package scala.actors.gui

import javax.swing._
import event.Event

class GUIApplication {
  def defaultLookAndFeelDecorated: boolean = true

  def init() = {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
    JFrame.setDefaultLookAndFeelDecorated(defaultLookAndFeelDecorated)
  }

  def run(prog: => unit): unit =
    SwingUtilities.invokeLater {
      new Runnable() {
        def run() = { init(); prog }
      }
    }
}