【发布时间】:2015-08-26 07:59:51
【问题描述】:
如何禁用 ControlsFX WizardPane 屏幕上的“上一个”按钮?我正在尝试使用这种方法prev.setDisable(true),但我所拥有的是NullPointerException。
public class MainApp extends Application {
Wizard wizard = new Wizard();
WizardPane1 page1 = new WizardPane1();
WizardPane page2 = new WizardPane();
WizardPane page3 = new WizardPane() {
@Override
public void onEnteringPage(Wizard wizard) {
Node prev = lookupButton(ButtonType.PREVIOUS);
prev.setDisable(true);
}
};
page1.setContent(page1.getInit());
wizard.setFlow(new LinearFlow(page1, page2, page3));
wizard.showAndWait();
}
public class WizardPane1 extends WizardPane {
public void initWizard() {}
}
【问题讨论】:
-
什么是向导类?
-
s.o.println(getButtonTypes()); 打印什么在 onEnteringPage() 方法中?
-
输出:[ButtonType [text=Vorheriger, buttonData=BACK_PREVIOUS], ButtonType [text=Nächster, buttonData=NEXT_FORWARD], ButtonType [text=Fertigstellen, buttonData=FINISH], ButtonType [text=Abbrechen, buttonData=CANCEL_CLOSE]]
-
我的文字是德语(text=....)
标签: javafx wizard controlsfx