JFoenix Drawer .hide();和.drawer();功能不起作用

时间:2017-11-20 17:51:55

标签: javafx drawer jfoenix

我很厌倦这一点,JFoenix抽屉.hide();.drawer();功能不起作用

try {
    VBox box = FXMLLoader.load(getClass().getResource("/chatroom/ui/chatingwindow/DrawerContent.fxml"));
    drawer.setSidePane(box);

    HamburgerBackArrowBasicTransition arrowBasicTransition = new HamburgerBackArrowBasicTransition(hamburger);
    arrowBasicTransition.setRate(-1);
    hamburger.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
        arrowBasicTransition.setRate(arrowBasicTransition.getRate() * -1);
        arrowBasicTransition.play();

        if (drawer.isShown()) {
            drawer.hide();
        } else {
            drawer.draw();
        }
    });

} catch (IOException ex) {
    Logger.getLogger(ChatingWindowController.class.getName()).log(Level.SEVERE, null, ex);
}  

为什么,任何Jfoenix教程都使用了这些功能,但是我无法使用它?

1 个答案:

答案 0 :(得分:2)

因为它们不存在应该是:

if (drawer.isOpened()) {
        drawer.close();
    } else {
        drawer.open();
    }