01: /*
02: * Created on 30/09/2004
03: *
04: * ============================================================================
05: * GNU Lesser General Public License
06: * ============================================================================
07: *
08: * Swing Components - visit http://sf.net/projects/gfd
09: *
10: * Copyright (C) 2004 Igor Regis da Silva Simões
11: *
12: * This library is free software; you can redistribute it and/or
13: * modify it under the terms of the GNU Lesser General Public
14: * License as published by the Free Software Foundation; either
15: * version 2.1 of the License, or (at your option) any later version.
16: *
17: * This library is distributed in the hope that it will be useful,
18: * but WITHOUT ANY WARRANTY; without even the implied warranty of
19: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20: * Lesser General Public License for more details.
21: *
22: * You should have received a copy of the GNU Lesser General Public
23: * License along with this library; if not, write to the Free Software
24: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
25: */
26: package br.com.gfpshare.beans;
27:
28: import java.awt.BorderLayout;
29: import java.awt.Dimension;
30: import java.awt.Frame;
31: import java.awt.HeadlessException;
32:
33: import javax.swing.JDialog;
34: import javax.swing.JEditorPane;
35:
36: /**
37: * @author Igor Regis da Silva Simoes
38: */
39: public class MessagerDialog extends JDialog {
40: private JEditorPane messageArea = new JEditorPane();
41:
42: /**
43: * @param owner
44: * @param title
45: * @throws java.awt.HeadlessException
46: */
47: public MessagerDialog(Frame owner, String title)
48: throws HeadlessException {
49: super (owner, title);
50: setModal(true);
51: setSize(new Dimension(400, 200));
52: setLocationRelativeTo(owner);
53: messageArea.setContentType("text/html");
54: messageArea.setEditable(false);
55: messageArea.setOpaque(false);
56: getContentPane().add(messageArea, BorderLayout.CENTER);
57: }
58:
59: /**
60: * @param message Mensagem a ser exibida pela dialog
61: */
62: public void setMessage(String message) {
63: messageArea.setText("<html><body><center><font size=6>"
64: + message + "</font></center></body></html>");
65: }
66:
67: }
|