prevent Group from lapping out of it's parent Pane
983777Jan 9 2013 — edited Jan 14 2013I added a group into a pane beside another. How can I prevent that a group laps out of it's parent pane.
Example Screenshot (Button is in another pane than the group):
http://imageshack.us/photo/my-images/62/groupv.jpg/
Example code :
-----
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javafxapplication1;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.CircleBuilder;
import javafx.stage.Stage;
/**
*
* @author DSE
*/
public class JavaFXApplication1 extends Application {
@Override
public void start(Stage primaryStage) {
BorderPane root = new BorderPane();
Button btn = new Button();
btn.setText("Why??");
root.setLeft(btn);
Group group = new Group();
root.setCenter(group);
Circle circle = CircleBuilder.create()
.centerX(0)
.centerY(0)
.radius(170)
.fill(Color.RED)
.build();
group.getChildren().add(circle);
Scene scene = new Scene(root, 300, 250);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
-----
Edited by: 980774 on 09.01.2013 04:44