Created
June 22, 2013 05:44
-
-
Save Centaur/5836007 to your computer and use it in GitHub Desktop.
scalafx borderpane layout error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Label; | |
import javafx.scene.control.TextAreaBuilder; | |
import javafx.scene.control.TreeView; | |
import javafx.scene.layout.BorderPaneBuilder; | |
import javafx.stage.Stage; | |
import javafx.scene.layout.BorderPane; | |
public class Main extends Application { | |
@Override | |
public void start(Stage stage) throws Exception { | |
BorderPane root = BorderPaneBuilder.create().left(new TreeView<>()).center( | |
new Label("hello") | |
).bottom( | |
TextAreaBuilder.create().text("hello").build() | |
).build(); | |
Scene scene = new Scene(root, 800, 600); | |
stage.setScene(scene); | |
stage.show(); | |
} | |
public static void main(String[] args) { | |
launch(Main.class, args); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalafx.application.JFXApp | |
import scalafx.application.JFXApp.PrimaryStage | |
import scalafx.scene.Scene | |
import scalafx.scene.layout.BorderPane | |
import scalafx.scene.control.{Label, TreeView, TextArea} | |
object Main extends JFXApp { | |
stage = new PrimaryStage { | |
width = 800 | |
height = 600 | |
scene = new Scene { | |
content = new BorderPane { | |
left = new TreeView | |
center = new Label("hello") | |
bottom = new TextArea { | |
text = "hello" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment