create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / gui / dialogs / DetailDialog.java
1 package net.sf.openrocket.gui.dialogs;
2
3 import java.awt.Component;
4
5 import javax.swing.JOptionPane;
6 import javax.swing.JScrollPane;
7 import javax.swing.JTextArea;
8
9 import net.sf.openrocket.gui.util.GUIUtil;
10
11 public class DetailDialog {
12         
13         public static void showDetailedMessageDialog(Component parentComponent, Object message,
14                         String details, String title, int messageType) {
15                 
16                 if (details != null) {
17                         JTextArea textArea = null;
18                         textArea = new JTextArea(5, 40);
19                         textArea.setText(details);
20                         textArea.setCaretPosition(0);
21                         textArea.setEditable(false);
22                         GUIUtil.changeFontSize(textArea, -2);
23                         JOptionPane.showMessageDialog(parentComponent,
24                                         new Object[] { message, new JScrollPane(textArea) },
25                                         title, messageType, null);
26                 } else {
27                         JOptionPane.showMessageDialog(parentComponent, message, title, messageType, null);
28                 }
29                 
30         }
31         
32
33 }