summaryrefslogtreecommitdiff
path: root/src/swing/scala/swing/SimpleSwingApplication.scala
blob: 786c7b4711b25272fa3de53becef6b43d80d0258 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package scala.swing

abstract class SimpleSwingApplication extends SwingApplication {
  def top: Frame

  override def startup(args: Array[String]) {
    val t = top
    if (t.size == new Dimension(0,0)) t.pack()
    t.visible = true
  }

  def resourceFromClassloader(path: String): java.net.URL =
    this.getClass.getResource(path)

  def resourceFromUserDirectory(path: String): java.io.File =
    new java.io.File(util.Properties.userDir, path)
}