List of usage examples for javafx.scene Group getChildren
@Override
public ObservableList<Node> getChildren()
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group root = new Group(); Scene scene = new Scene(root, 550, 250, Color.hsb(270, 1.0, 1.0, 1.0)); Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com"); Font sanSerif = Font.font("Dialog", 30); text.setFont(sanSerif);/*from www.j av a 2s . c om*/ text.setFill(Color.RED); root.getChildren().add(text); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group group = new Group(); Scene scene = new Scene(group); Label title = new Label("Label 1"); StackPane stackpane = new StackPane(); StackPane.setAlignment(title, Pos.BOTTOM_CENTER); stackpane.getChildren().addAll(new Label("Label"), title); group.getChildren().add(stackpane); stage.setTitle("Welcome to JavaFX!"); stage.setScene(scene);/*from w w w .j a va 2s.c o m*/ stage.sizeToScene(); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group rectangleGroup = new Group(); Scene scene = new Scene(rectangleGroup, 550, 250); Rectangle rect = new Rectangle(); rect.setWidth(100);//from w w w . j av a2s . com rect.setHeight(100); Shear sh = new Shear(); sh.setY(0.4); rect.getTransforms().add(sh); rectangleGroup.getChildren().add(rect); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group root = new Group(); Scene scene = new Scene(root, 550, 250, Color.web("0x0000FF", 1.0)); Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com"); Font sanSerif = Font.font("Dialog", 30); text.setFont(sanSerif);/* ww w . j a v a 2s.c o m*/ text.setFill(Color.RED); root.getChildren().add(text); BoxBlur bb = new BoxBlur(); bb.setWidth(15); bb.setHeight(15); bb.setIterations(3); text.setEffect(bb); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 500, 200); stage.setScene(scene);//from w w w . j a v a 2 s . c o m Rectangle rect = new Rectangle(200, 200, Color.RED); ScrollPane s1 = new ScrollPane(); s1.setPannable(true); s1.setPrefSize(120, 120); s1.setContent(rect); root.getChildren().add(s1); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle(""); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); Group g = new Group(); Text t = new Text(); t.setX(10.0);/* w w w . j av a 2s . com*/ t.setY(40.0); t.setCache(true); t.setText("Blurry Text"); t.setFill(Color.RED); t.setFont(Font.font(null, FontWeight.BOLD, 36)); t.setEffect(new GaussianBlur()); g.getChildren().add(t); root.getChildren().add(g); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 300, 150); stage.setScene(scene);//from ww w. j av a 2s .c o m stage.setTitle("Sample"); Text t = new Text(10, 50, "This is a test"); t.setTextAlignment(TextAlignment.JUSTIFY); t.setText("First row"); t.setFont(new Font(20)); root.getChildren().add(t); stage.show(); }
From source file:view.TimelinePanel.java
/** * Creates new form TimelinePanel//w w w . j av a2 s .c o m */ public TimelinePanel() { initComponents(); fxPanel = new JFXPanel(); final Dimension size = new Dimension(960, 750); fxPanel.setSize(size); setLayout(new BorderLayout(0, 0)); add(fxPanel); Platform.runLater(new Runnable() { // this will run initFX as JavaFX-Thread @Override public void run() { Group group = new Group(); Scene scene = new Scene(group); fxPanel.setScene(scene); WebView webView = new WebView(); group.getChildren().add(webView); webView.setMinSize(size.getWidth(), size.getHeight()); webView.setMaxSize(size.getWidth(), size.getHeight()); WebEngine webEngine = webView.getEngine(); webEngine.load( "http://cdn.knightlab.com/libs/timeline/latest/embed/index.html?source=0Ag1_iE674IuvdEFaZi0wOVBFY2l2OHdPUWlrZEMwaHc&font=Bevan-PotanoSans&maptype=toner&lang=en"); } }); }
From source file:Main.java
@Override public void start(final Stage stage) throws Exception { Group rootGroup = new Group(); Scene scene = new Scene(rootGroup, 800, 400); Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.CHOCOLATE); text1.setFont(Font.font(java.awt.Font.MONOSPACED, 35)); Effect glow = new Glow(1.0); text1.setEffect(glow);//w w w . j a v a2 s . c o m rootGroup.getChildren().add(text1); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle(""); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); Group g = new Group(); DropShadow ds1 = new DropShadow(); ds1.setOffsetY(4.0);// w w w.j a v a 2 s .c om Circle c = new Circle(); c.setEffect(ds1); c.setCenterX(50.0); c.setCenterY(125.0); c.setRadius(30.0); c.setFill(Color.RED); c.setCache(true); g.getChildren().add(c); root.getChildren().add(g); primaryStage.setScene(scene); primaryStage.show(); }