title: How to work with try-catch in JavaFX?
body: <p>I'm doing this project as a school project and one of the compulsory things is to catch something that user doesn't do right.</p>
  
  <p>I have this list of cards where user can add or remove cards. I wanted to use a try-catch on the removal part - if the user tries to remove one of the default cards (not user input card) it will display an error.</p>
  
  <p>I would like to do is notify user with a label that it is impossible for him to remove it. It would be simple to do with if-else but how to do it with try-catch?</p>
  
  <pre><code>eemalda.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
      public void handle(final ActionEvent event) {
          if (((Kaardid) kaardid2.get(kaardid2.size() - 1))
                  .getKaardi_nimi().contains("Ei pea jooma see ring")) { // after this if should be try-catch
              viimane_kaart.setText("Viimane sisestatud kaart on Baila originaalkaart");
          } else { // after this comes the other stuff program does
              kaardid2.remove(kaardid2.get(kaardid2.size() - 1));
              seadetemant.setVisible(false);
          }
      }
  });
  </code></pre>