[英]JavaFX SplitPane not working
我嘗試從此處實現一個標准示例,如下所示:
SplitPane sp = new SplitPane();
final StackPane sp1 = new StackPane();
sp1.getItems().add(new Button("Button One"));
final StackPane sp2 = new StackPane();
sp2.getItems().add(new Button("Button Two"));
final StackPane sp3 = new StackPane();
sp3.getItems().add(new Button("Button Three"));
sp.getItems().addAll(sp1, sp2, sp3);
sp.setDividerPositions(0.3f, 0.6f, 0.9f);
但是在NetBeans IDE中,我收到“找不到符號”消息,該消息指向使用getItems
方法的代碼行。 因此,我在IDE中使用了sp1
變量,並且看到不再有任何getItems
,但是我不知道該用什么。
StackPane
沒有getItems
方法,它使用getChildren()
!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.