public void showError(Throwable t, String resource) {
    String text;
    try {
        text = resources.getString(resource + ".text");
    } catch (MissingResourceException e) {
        text = resources.getString("error.text");
    }
    
    String title;
    try {
        title = resources.getString(resource + ".title");
    } catch (MissingResourceException e) {
        title = resources.getString("error.title");
    }
    
    String reason = resources.getString("error.reason");
    String message = text + "\n" + MessageFormat.format(reason, new Object[] { t });
    
    JOptionPane.showMessageDialog(this, message, title, JOptionPane.ERROR_MESSAGE);
}