Je suis en train d'attraper une exception puis l'afficher dans un JTextArea mais je suis obtenir nulle ...Java - getMessage() retourne null
Ici, il est:
} catch (Exception rwe) {
// System.exit(0);
game.remove(yPanel);
game.remove(xPanel);
game.remove(roomPanel);
game.remove(userPanel);
game.remove(titlePanel);
game.remove(introPanel);
remove(game);
remove(sp);
remove(invOne);
remove(main);
remove(say);
add(statusPanel);
JTextArea errorText = new JTextArea();
errorText.append("Here is the reason why it crashed:\n" +rwe.getMessage());
errorText.setPreferredSize(new Dimension(500,300));
System.out.println("errorrr:" + rwe.getMessage());
statusPanel.add(errorText);
statusPanel.setOpaque(true);
labelStatus.setVisible(true);
System.out.println("Server crashed");
c.append("\nServer crashed...");
rwe.printStackTrace();
}
et lorsqu'un erreur se produit que je reçois ce à l'intérieur du JTextArea:
Here is the reason why it crashed:
null
Pourquoi?