-
Bug
-
Resolution: Fixed
-
P4
-
7u6
-
2.2.0b08. Win7, Linux12. X64 x32.
Run code, press button:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Ellipse;
import javafx.scene.text.Text;
import javafx.stage.Popup;
import javafx.stage.Stage;
public class MenuButtonApp extends Application {
private Popup p1;
private Button parentButton;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
p1 = new Popup();
parentButton = new Button("Parent");
parentButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
p1.show(p1, 100, 100);
}
});
p1.setAutoFix(true);
p1.setAutoHide(false);
StackPane stack = new StackPane();
Ellipse ellipse = new Ellipse(70.0F, 50.0F);
ellipse.setFill(Color.AQUAMARINE);
stack.getChildren().clear();
stack.getChildren().addAll(ellipse, new Text("Popup!!"));
p1.getContent().clear();
p1.getContent().addAll(stack);
Scene scene = new Scene(new Group(), 300, 300);
VBox vbox = new VBox(5.0F);
vbox.getChildren().clear();
vbox.getChildren().addAll(parentButton);
((Group) scene.getRoot()).getChildren().clear();
((Group) scene.getRoot()).getChildren().addAll(vbox);
stage.setScene(scene);
stage.show();
}
}
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Ellipse;
import javafx.scene.text.Text;
import javafx.stage.Popup;
import javafx.stage.Stage;
public class MenuButtonApp extends Application {
private Popup p1;
private Button parentButton;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
p1 = new Popup();
parentButton = new Button("Parent");
parentButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
p1.show(p1, 100, 100);
}
});
p1.setAutoFix(true);
p1.setAutoHide(false);
StackPane stack = new StackPane();
Ellipse ellipse = new Ellipse(70.0F, 50.0F);
ellipse.setFill(Color.AQUAMARINE);
stack.getChildren().clear();
stack.getChildren().addAll(ellipse, new Text("Popup!!"));
p1.getContent().clear();
p1.getContent().addAll(stack);
Scene scene = new Scene(new Group(), 300, 300);
VBox vbox = new VBox(5.0F);
vbox.getChildren().clear();
vbox.getChildren().addAll(parentButton);
((Group) scene.getRoot()).getChildren().clear();
((Group) scene.getRoot()).getChildren().addAll(vbox);
stage.setScene(scene);
stage.show();
}
}