在JavaFX BorderPane中添加和删除内容时,我遇到了调整大小问题.在手动调整窗口大小之前,不会调整BorderPane内容的大小.我写了一个小测试应用程序来模拟这种行为.该应用程序构建一个BorderPane,其中包含嵌入在BorderPane中心的StackPane中的矩形.在BorderPane的底部有一个包含文本和分隔符的VBox和HBox.有一个菜单项可以从BorderPane的底部删除内容(MoveText - > Right),并将类似的内容添加到BorderPane的正确位置.
当文本添加到BorderPane的右侧位置时,矩形与文本重叠.换句话说,BorderPane中心的内容与BorderPane权限中的内容重叠.
我看到以下链接 - /sf/ask/371153821/ 呼叫requestLayout似乎没有帮助.我也尝试在图中的各个节点上调用impl_updatePG和impl_transformsChanged.我从这个帖子中得到了这个想法 - https://forums.oracle.com/forums/thread.jspa?threadID=2242083
public class BorderPaneExample extends Application
{
private BorderPane root;
private StackPane centerPane;
@Override
public void start(Stage primaryStage) throws Exception
{
root = new BorderPane();
root.setTop(getMenu());
root.setBottom(getBottomVBox());
centerPane = getCenterPane();
root.setCenter(centerPane);
Scene scene = new Scene(root, 900, 500);
primaryStage.setTitle("BorderPane Example");
primaryStage.setScene(scene);
primaryStage.show();
}
private MenuBar getMenu()
{
MenuBar menuBar = new MenuBar();
MenuItem rightMenuItem = new MenuItem("Right");
rightMenuItem.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
root.setRight(getRightHBox());
root.setBottom(null);
root.requestLayout(); …Run Code Online (Sandbox Code Playgroud) 运行SonarQube IntelliJ分析插件时出现以下错误
14:40:35.544 INFO - Apply project exclusions
Exception in thread "main" org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41)
at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59)
Caused by: java.lang.IllegalArgumentException: 'sonar.projectDate' property cannot be older than the date of the last known quality snapshot on this project. Value: '2014-01-23T14:40:35-0700'. Latest quality snapshot: '2014-01-23'. This property may only be used to rebuild the past in a chronological order.
at
org.sonar.batch.ProjectConfigurator.checkCurrentAnalysisIsTheLatestOne(ProjectConfigurator.java:87)
at org.sonar.batch.ProjectConfigurator.configure(ProjectConfigurator.java:71)
at org.sonar.batch.DefaultProjectTree.doStart(DefaultProjectTree.java:72)
at org.sonar.batch.DefaultProjectTree.start(DefaultProjectTree.java:49) …Run Code Online (Sandbox Code Playgroud)