Skip to content

Instantly share code, notes, and snippets.

@Centaur
Created June 22, 2013 05:44
Show Gist options
  • Save Centaur/5836007 to your computer and use it in GitHub Desktop.
Save Centaur/5836007 to your computer and use it in GitHub Desktop.
scalafx borderpane layout error
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);
}
}
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