private JButton makeGoButton( @NotNull final String toolTipText, @NotNull final Icon icon, final int direction) { final JButton button = new JButton(icon); button.setEnabled(false); button.addMouseListener( new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { Platform.runLater(() -> myEngine.getHistory().go(direction)); } } }); button.setToolTipText(toolTipText); return button; }