Guest User

Untitled

a guest
May 27th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // TornadoFX has View, Controller, and Model components, allowing you to separate your code cleanly.
  2. class MyApp: View() {
  3. // global variables
  4. val numCol: Int = 8
  5.  
  6. // every view has a root component
  7. override val root = gridpane {
  8. vgap = 15.0
  9. padding = insets(15)
  10. for (var i in 1..numCol) {
  11. add(horizontalStreetPane())
  12. }
  13. }
  14.  
  15. fun horizontalStreetPane(): StackPane {
  16. return stackpane {
  17. rectangle {
  18. fill = c("4E9830")
  19. width = 100.0
  20. height = 100.0
  21. }
  22. rectangle {
  23. fill = c("919191")
  24. width = 100.0
  25. height= 40.0
  26. }
  27. }
  28. }
  29. }
Add Comment
Please, Sign In to add comment