英文:
Returning to a specific tab when closing a tab - JavaFx
问题
我正在尝试创建一个新的选项卡,在用户点击ListView中的任何项时提供一些额外的信息。我成功地动态添加了新的选项卡并关闭了它们。我还成功切换到了新创建的选项卡。因此,新的选项卡弹出并且我可以自动看到它。但是我找不到在关闭额外信息选项卡时返回到我的原始选项卡的方法。它会自动返回到它之前的选项卡。所创建的选项卡是第四个选项卡,当我关闭它时,它会返回到第三个选项卡,但我希望它返回到第二个选项卡。有没有办法解决这个问题。我没有使用FXML文件。
英文:
I am trying to create a new tab that gives some extra info when the user clicks on any item in a ListView. I managed to dynamically add new tabs and close them. I've also managed to switch to the newly created tab . So the new tab pops up and I can automatically see it. But I couldn't find a way to return to my original tab when the extra info tab is closed. It automatically returns to the tab before to it. Created tab is the fourth tab, when I close it, it goes back to the third tab, but I want it to go to the second tab. Is there any way to fix this. I don't use an FXML file.
专注分享java语言的经验与见解,让所有开发者获益!
评论