Advertisement
Guest User

tmp01

a guest
Dec 19th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.80 KB | None | 0 0
  1. import scalafx.application.JFXApp
  2. import scalafx.application.JFXApp.PrimaryStage
  3. import scalafx.event.ActionEvent
  4. import scalafx.scene.Scene
  5. import scalafx.scene.control.Button
  6. import scalafx.scene.layout.AnchorPane
  7.  
  8. object SomeApp extends JFXApp {
  9.  
  10.   stage = new PrimaryStage {
  11.     title = "SomeApp"
  12.     width = 800
  13.     height = 600
  14.  
  15.     val TheButton = new Button("Add a Button") {
  16.       onAction = {
  17.         e: ActionEvent => {
  18.           root.dd(new Button("Some Button"))
  19.         }
  20.       }
  21.     }
  22.  
  23.     val SomeLayout = new AnchorPane {
  24.       styleClass += "someStyle"
  25.  
  26.       content = TheButton
  27.     }
  28.  
  29.     scene = new Scene {
  30.       stylesheets = List(getClass.getResource("Extend.css").toExternalForm)
  31.  
  32.       root = new AnchorPane {
  33.  
  34.         content = SomeLayout
  35.       }
  36.     }
  37.   }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement