Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.AnchorPane
- object SomeApp extends JFXApp {
- stage = new PrimaryStage {
- title = "SomeApp"
- width = 800
- height = 600
- val TheButton = new Button("Add a Button") {
- onAction = {
- e: ActionEvent => {
- root.dd(new Button("Some Button"))
- }
- }
- }
- val SomeLayout = new AnchorPane {
- styleClass += "someStyle"
- content = TheButton
- }
- scene = new Scene {
- stylesheets = List(getClass.getResource("Extend.css").toExternalForm)
- root = new AnchorPane {
- content = SomeLayout
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement