没有搜索到相关的 就分享一下我的方法
if(CenterPane.getChildren().contains(mypath))
{
CenterPane.getChildren().remove(mypath);
CenterPane.getChildren().add(mypath);
}
就是先判断一下是否包含这个控件,要是包含就移除再添加。
这样就可以始终保持在最顶层了。
如果有更好的方法,请分享给我。谢谢。
没有搜索到相关的 就分享一下我的方法
if(CenterPane.getChildren().contains(mypath))
{
CenterPane.getChildren().remove(mypath);
CenterPane.getChildren().add(mypath);
}
就是先判断一下是否包含这个控件,要是包含就移除再添加。
这样就可以始终保持在最顶层了。
如果有更好的方法,请分享给我。谢谢。