1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
try
{
// mon code qui provoque l'erreur
}
catch (OutOfMemoryError ex)
{
JOptionPane.showMessageDialog(this, ex.getMessage(), "Critical Error.", JOptionPane.ERROR_MESSAGE);
Logger.getLogger(MonProjet.class.getName()).log(Level.SEVERE, null, ex);
System.gc();
System.exit(-1);
}
catch (Error ex)
{
JOptionPane.showMessageDialog(this, ex.getMessage(), "Critical Error.", JOptionPane.ERROR_MESSAGE);
Logger.getLogger(MonProjet.class.getName()).log(Level.SEVERE, null, ex);
System.gc();
System.exit(-1);
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(this, ex.getMessage(), "Critical Error.", JOptionPane.ERROR_MESSAGE);
Logger.getLogger(MonProjet.class.getName()).log(Level.SEVERE, null, ex);
System.gc();
System.exit(-1);
} |
Partager