Does anybody have expirience with creating animated menubar in javafx. I need show menu bar when mouse moved on top, and hide when mouse leave this area(25px on top). Currently i have some sollution, but it looks not so pretty like i want, just show/hide without any sliding)))
root.setOnMouseMoved(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
if (event.getY() < 25){
menuBar.setVisible(true);
root.setTopAnchor(clipPane, 35.0);
} else {
if (menuBar.isVisible()) {
menuBar.setVisible(false);
}
if (menuFile.isShowing()) {
try {
Robot bot = new Robot();
bot.mousePress(InputEvent.BUTTON1_MASK);
bot.mouseRelease(InputEvent.BUTTON1_MASK);
} catch (AWTException ex) {
}
}
root.setTopAnchor(clipPane, 0.0);
}
}
});
So can somebody help with information how to add sliding effect for show/hide menubar?