You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FatalErrorDialog.java 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * FatalErrorDialog.java
  3. *
  4. * Created on 01 March 2007, 03:50
  5. */
  6. package uk.org.ownage.dmdirc.ui;
  7. import java.awt.event.ActionEvent;
  8. import java.awt.event.ActionListener;
  9. import uk.org.ownage.dmdirc.logger.Logger;
  10. /**
  11. *
  12. * @author chris
  13. */
  14. public class FatalErrorDialog extends javax.swing.JDialog {
  15. /**
  16. * A version number for this class. It should be changed whenever the class
  17. * structure is changed (or anything else that would prevent serialized
  18. * objects being unserialized with the new class).
  19. */
  20. private static final long serialVersionUID = 1;
  21. public FatalErrorDialog(java.awt.Frame parent, boolean modal, String[] message) {
  22. super(parent, modal);
  23. initComponents();
  24. for (String line: message) {
  25. jTextArea1.append(line+"\r\n");
  26. }
  27. jTextArea1.setCaretPosition(0);
  28. }
  29. /** This method is called from within the constructor to
  30. * initialize the form.
  31. * WARNING: Do NOT modify this code. The content of this method is
  32. * always regenerated by the Form Editor.
  33. */
  34. // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  35. private void initComponents() {
  36. jLabel1 = new javax.swing.JLabel();
  37. jLabel2 = new javax.swing.JLabel();
  38. jLabel3 = new javax.swing.JLabel();
  39. jScrollPane1 = new javax.swing.JScrollPane();
  40. jTextArea1 = new javax.swing.JTextArea();
  41. jButton1 = new javax.swing.JButton();
  42. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  43. setTitle("DMDirc - an error occured");
  44. addWindowListener(new java.awt.event.WindowAdapter() {
  45. public void windowClosing(java.awt.event.WindowEvent evt) {
  46. formWindowClosing(evt);
  47. }
  48. });
  49. jLabel1.setFont(new java.awt.Font("Dialog", 1, 18));
  50. jLabel1.setText("We're sorry...");
  51. jLabel2.setText("DMDirc has encountered a fatal error and cannot continue.");
  52. jLabel3.setText("Error details:");
  53. jTextArea1.setColumns(20);
  54. jTextArea1.setEditable(false);
  55. jTextArea1.setRows(5);
  56. jScrollPane1.setViewportView(jTextArea1);
  57. jButton1.setText("OK");
  58. jButton1.addActionListener(new java.awt.event.ActionListener() {
  59. public void actionPerformed(java.awt.event.ActionEvent evt) {
  60. jButton1ActionPerformed(evt);
  61. }
  62. });
  63. org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
  64. getContentPane().setLayout(layout);
  65. layout.setHorizontalGroup(
  66. layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  67. .add(layout.createSequentialGroup()
  68. .addContainerGap()
  69. .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  70. .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 443, Short.MAX_VALUE)
  71. .add(jLabel1)
  72. .add(org.jdesktop.layout.GroupLayout.TRAILING, jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  73. .add(jLabel3)
  74. .add(jLabel2))
  75. .addContainerGap())
  76. );
  77. layout.setVerticalGroup(
  78. layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
  79. .add(layout.createSequentialGroup()
  80. .addContainerGap()
  81. .add(jLabel1)
  82. .add(23, 23, 23)
  83. .add(jLabel2)
  84. .add(21, 21, 21)
  85. .add(jLabel3)
  86. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
  87. .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 246, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
  88. .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 9, Short.MAX_VALUE)
  89. .add(jButton1)
  90. .addContainerGap())
  91. );
  92. pack();
  93. }// </editor-fold>//GEN-END:initComponents
  94. private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
  95. System.exit(-1);
  96. }//GEN-LAST:event_formWindowClosing
  97. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
  98. System.exit(-1);
  99. }//GEN-LAST:event_jButton1ActionPerformed
  100. // Variables declaration - do not modify//GEN-BEGIN:variables
  101. private javax.swing.JButton jButton1;
  102. private javax.swing.JLabel jLabel1;
  103. private javax.swing.JLabel jLabel2;
  104. private javax.swing.JLabel jLabel3;
  105. private javax.swing.JScrollPane jScrollPane1;
  106. private javax.swing.JTextArea jTextArea1;
  107. // End of variables declaration//GEN-END:variables
  108. }