Simple windowed application: Difference between revisions
Content added Content deleted
m (→{{header|Objective-C}}: modernize) |
|||
Line 1,614: | Line 1,614: | ||
=={{header|Scala}}== |
=={{header|Scala}}== |
||
[[Category:Scala Implementations]] |
|||
<lang scala>import scala.swing._ |
|||
{{libheader|Scala}} |
|||
⚫ | |||
<lang Scala>import scala.swing.{ BorderPanel, Button, Label, MainFrame, SimpleSwingApplication } |
|||
import scala.swing.Swing._ |
|||
⚫ | |||
object SimpleApp extends SimpleSwingApplication { |
object SimpleApp extends SimpleSwingApplication { |
||
def top = new MainFrame { |
def top = new MainFrame { |
||
⚫ | |||
⚫ | |||
text = "click me" |
|||
} |
|||
val label = new Label { |
|||
⚫ | |||
} |
|||
contents = new BorderPanel { |
contents = new BorderPanel { |
||
⚫ | |||
⚫ | |||
⚫ | |||
layout(button) = BorderPanel.Position.South |
layout(button) = BorderPanel.Position.South |
||
layout(label) = BorderPanel.Position.Center |
layout(label) = BorderPanel.Position.Center |
||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
preferredSize = ((300, 200): Dimension) |
|||
nClicks += 1 |
|||
⚫ | |||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
} |
} |