title: Error messages with Java Swing
body: <p>I have a query on handling error conditions with Java Swing.</p>
  
  <p>I am using Netbeans to develop a simple Java Swing app. It is to load in a text file, then run calculation based on the numbers found in the text file. The main Swing class holds the JFrames and JPanels. </p>
  
  <p>I have the file loading code as a separate class file. It returns the number of lines read and a List of numbers back to the main Swing app. </p>
  
  <p>I realised that if the file reading fails (i.e. try -> catch (Exception ex)), the entire app will crash. What's the best way to handle errors resulting from my scenario above? That is to say, the file loading code crashes and I don't want the entire program to crash. I want the program to say the file is corrupted and wait for user to load new file.</p>
  
  <p>Any thoughts?</p>
  
  <p>Yakult</p>