Joe*_*nst 5 listener splitpane javafx-8
我不知道如何在 JavaFX 8 SplitPane 上监听“Divider Repositioned”事件。这是一个简单的工作应用程序,只需要添加事件侦听器。有人可以帮助我指出正确的方向吗?
public class TestCase extends Application {
public void start(Stage primaryStage) throws Exception {
Pane leftPane = new Pane();
Pane rightPane = new Pane();
SplitPane splitPane = new SplitPane(leftPane, rightPane);
// Need to create a listener that fires whenever the SplitPane's Divider is repositioned
// Within this listener I need access to the leftPane and rightPane so I can call requestLayout()
primaryStage.setScene(new Scene(splitPane));
primaryStage.setWidth(800);
primaryStage.setHeight(600);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2457 次 |
| 最近记录: |