1

我对此感到厌倦,JFoenix Drawer.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 教程都使用了该功能,但我不能使用它?

4

1 回答 1

2

这是因为它们不存在它应该是:

if (drawer.isOpened()) {
        drawer.close();
    } else {
        drawer.open();
    }
于 2017-11-20T22:26:24.673 回答