Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

prevent Group from lapping out of it's parent Pane

983777Jan 9 2013 — edited Jan 14 2013
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2013
Added on Jan 9 2013
8 comments
2,041 views