01: /*
02: * Copyright (C) Jakub Neubauer, 2007
03: *
04: * This file is part of TaskBlocks
05: *
06: * TaskBlocks is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU General Public License as published by
08: * the Free Software Foundation; either version 3 of the License, or
09: * (at your option) any later version.
10: *
11: * TaskBlocks is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program. If not, see <http://www.gnu.org/licenses/>.
18: */
19:
20: package taskblocks.app;
21:
22: import java.awt.Component;
23: import java.awt.Font;
24:
25: import javax.swing.Box;
26: import javax.swing.JDialog;
27: import javax.swing.JLabel;
28: import javax.swing.JOptionPane;
29: import javax.swing.SwingConstants;
30: import javax.swing.border.EmptyBorder;
31:
32: public class AboutDialog {
33: public static void showAbout(Component parent) {
34:
35: Box b = Box.createVerticalBox();
36: Box b2 = Box.createHorizontalBox();
37: JLabel l3 = new JLabel();
38: JLabel l1 = new JLabel("<html><h2>Task Blocks</h2>Version "
39: + Version.VERSION);
40: JLabel l2 = new JLabel("<html><br>"
41: + "<center>Copyright \u00A9 2007 Jakub Neubauer<br>"
42: + "<http://taskblocks.googlecode.com>"
43: + "</center><br>");
44: l3.setIcon(TaskBlocks.getImage("taskblocks.png"));
45: l1.setIconTextGap(30);
46: l1.setHorizontalTextPosition(SwingConstants.LEFT);
47: l1.setFont(l1.getFont().deriveFont(Font.PLAIN));
48: l2.setFont(l2.getFont().deriveFont(Font.PLAIN));
49: b2.add(l1);
50: b2.add(l3);
51: b.add(b2);
52: b.add(l2);
53: l3.setBorder(new EmptyBorder(0, 0, 0, 20));
54:
55: l1.setAlignmentX(0f);
56: l2.setAlignmentX(0f);
57: l3.setAlignmentX(0f);
58: b2.setAlignmentX(0f);
59:
60: JOptionPane op = new JOptionPane(b);
61: JDialog d = op.createDialog(parent, "About");
62: d.setVisible(true);
63: }
64:
65: public static void main(String[] args) {
66: AboutDialog.showAbout(null);
67: }
68: }
|