private void updateHistoryButtons(){
  historyForwardButton.setEnabled(history.hasNext());
  historyBackButton.setEnabled(history.hasPrevious());
}

private void updateHistoryButtons ( ) { historyForwardButton . setEnabled ( history . hasNext ( ) ) ; historyBackButton . setEnabled ( history . hasPrevious ( ) ) ; }
enable / disable the history buttons based on whether there is something to go to in the history .
