KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SnowMailClient > view > MessagesPreview > MessagePreview


1 package SnowMailClient.view.MessagesPreview;
2
3 import java.awt.BorderLayout JavaDoc;
4 import snow.utils.gui.CloseControlPanel;
5 import snow.Language.Language;
6 import SnowMailClient.model.Header;
7 import javax.swing.*;
8 import javax.swing.event.*;
9 import java.awt.event.*;
10
11 /** class MessagePreview.
12 */

13 public final class MessagePreview extends JDialog
14 {
15    JTextPane pane = new JTextPane();
16
17    /** Constructor. */
18    public MessagePreview(JDialog parent, Header ph, String JavaDoc cont)
19    {
20       super(parent, Language.translate("Messages Preview"), false);
21       this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
22
23       pane.setContentType("text/plain");
24       pane.setText(cont);
25       pane.setEditable(false);
26       add(new JScrollPane(pane), BorderLayout.CENTER);
27
28       CloseControlPanel ccp = new CloseControlPanel(this, false, true, Language.translate("close"));
29
30       setSize(400,500);
31       this.setLocationRelativeTo(parent);
32
33       this.setVisible(true); // NOT MODAL!
34
}
35
36 } // MessagePreview
Popular Tags