001    /******************************************************************************
002     * Copyright (C) MActor Developers. All rights reserved.                        *
003     * ---------------------------------------------------------------------------*
004     * This file is part of MActor.                                               *
005     *                                                                            *
006     * MActor is free software; you can redistribute it and/or modify             *
007     * it under the terms of the GNU General Public License as published by       *
008     * the Free Software Foundation; either version 2 of the License, or          *
009     * (at your option) any later version.                                        *
010     *                                                                            *
011     * MActor is distributed in the hope that it will be useful,                  *
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
014     * GNU General Public License for more details.                               *
015     *                                                                            *
016     * You should have received a copy of the GNU General Public License          *
017     * along with MActor; if not, write to the Free Software                      *
018     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA *
019     ******************************************************************************/
020    package org.mactor.ui.gui;
021    
022    import java.awt.BorderLayout;
023    import java.awt.Dimension;
024    import java.awt.Frame;
025    import java.awt.event.ActionEvent;
026    import java.awt.event.ActionListener;
027    import java.io.IOException;
028    
029    import javax.swing.BorderFactory;
030    import javax.swing.JButton;
031    import javax.swing.JDialog;
032    import javax.swing.JEditorPane;
033    import javax.swing.JPanel;
034    import javax.swing.JScrollPane;
035    
036    public class AboutDlg extends JDialog {
037            public AboutDlg(Frame parent) throws IOException {
038                    super(parent);
039                    setModal(true);
040                    setLayout(new BorderLayout());
041                    setTitle("MActor - About");
042                    JEditorPane aboutPane = new JEditorPane(Thread.currentThread().getContextClassLoader().getResource("ABOUT"));
043                    aboutPane.setEditable(false);
044                    aboutPane.addHyperlinkListener(BrowserUtil.createLinkListener());
045                    // aboutPane.setBackground(Color.LIGHT_GRAY);
046                    JScrollPane sp = new JScrollPane(aboutPane);
047                    sp.setPreferredSize(new Dimension(580, 400));
048                    sp.setBorder(BorderFactory.createRaisedBevelBorder());
049                    add(sp, BorderLayout.CENTER);
050                    JButton b = new JButton("Ok");
051                    JPanel bp = new JPanel();
052                    bp.add(b);
053                    add(bp, BorderLayout.SOUTH);
054                    b.addActionListener(new ActionListener() {
055                            public void actionPerformed(ActionEvent arg0) {
056                                    AboutDlg.this.setVisible(false);
057                            }
058                    });
059                    pack();
060                    setResizable(false);
061            }
062    }