KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > applications > jmail > base > AttachedFileDialog


1 package org.lucane.applications.jmail.base;
2
3 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4  * This file is part of JMail *
5  * Copyright (C) 2002-2003 Yvan Norsa <norsay@wanadoo.fr> *
6  * *
7  * JMail is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * any later version. *
11  * *
12  * JMail is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License along *
18  * with JMail; if not, write to the Free Software Foundation, Inc., *
19  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20  * *
21  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

22
23 import java.util.*;
24 import javax.swing.*;
25
26 /** This class displays an attached file in a new dialog
27  * FIXME : display it properly in a window (800 * 600 max) with scrollbars !
28  */

29 final class AttachedFileDialog extends JDialog
30 {
31     /** Constructor
32      * @param title name of the file
33      * @param comp the component (= content of the file) to be displayed
34      * @param msgBundle language resource
35      */

36     protected AttachedFileDialog(String JavaDoc title, JComponent comp, ResourceBundle msgBundle)
37     {
38     super((JFrame)null, title, true);
39
40     JPanel panel = new JPanel();
41
42     JScrollPane scrollPane = new JScrollPane(comp);
43     panel.add(scrollPane);
44
45     setContentPane(panel);
46        
47     setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
48     pack();
49     setVisible(true);
50     }
51 }
52
Popular Tags