Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scalafx.Includes._
- import scalafx.application.JFXApp
- import scalafx.application.JFXApp.PrimaryStage
- import scalafx.event.ActionEvent
- import scalafx.scene.Scene
- import scalafx.scene.control.Button
- import scalafx.scene.layout.VBox
- object SomeApp extends JFXApp {
- stage = new PrimaryStage {
- title = "SomeApp"
- width = 800
- height = 600
- val EmptyLayout = new VBox
- val TheButton = new Button("Add a Button") {
- onAction = {
- e: ActionEvent => {
- EmptyLayout.content.addAll(new Button("Test"))
- }
- }
- }
- val SomeLayout = new VBox {
- content = TheButton
- }
- scene = new Scene {
- root = new VBox {
- content = SomeLayout
- content += EmptyLayout
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement