3 import java.awt.Component;
5 import java.awt.event.ActionEvent;
6 import java.awt.event.ActionListener;
8 import javax.swing.BorderFactory;
9 import javax.swing.BoxLayout;
10 import javax.swing.JButton;
11 import javax.swing.JDialog;
12 import javax.swing.JEditorPane;
13 import javax.swing.JFrame;
14 import javax.swing.JLabel;
15 import javax.swing.JPanel;
17 import tim.prune.GpsPruner;
18 import tim.prune.I18nManager;
21 * Class to represent the "About" popup window
23 public class AboutScreen extends JDialog
29 public AboutScreen(JFrame inParent)
31 super(inParent, I18nManager.getText("dialog.about.title"));
32 getContentPane().add(makeContents());
37 * @return the contents of the window as a Component
39 private Component makeContents()
41 JPanel mainPanel = new JPanel();
42 mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
43 mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
44 JLabel titleLabel = new JLabel("Prune");
45 titleLabel.setFont(new Font("SansSerif", Font.BOLD, 24));
46 titleLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT);
47 mainPanel.add(titleLabel);
48 JLabel versionLabel = new JLabel(I18nManager.getText("dialog.about.version") + ": " + GpsPruner.VERSION_NUMBER);
49 versionLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT);
50 mainPanel.add(versionLabel);
51 JLabel buildLabel = new JLabel(I18nManager.getText("dialog.about.build") + ": " + GpsPruner.BUILD_NUMBER);
52 buildLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT);
53 mainPanel.add(buildLabel);
54 mainPanel.add(new JLabel(" "));
55 StringBuffer descBuffer = new StringBuffer();
56 descBuffer.append("<p>").append(I18nManager.getText("dialog.about.summarytext1")).append("</p>");
57 descBuffer.append("<p>").append(I18nManager.getText("dialog.about.summarytext2")).append("</p>");
58 descBuffer.append("<p>").append(I18nManager.getText("dialog.about.summarytext3")).append("</p>");
59 descBuffer.append("<p>").append(I18nManager.getText("dialog.about.translatedby")).append("</p>");
60 JEditorPane descPane = new JEditorPane("text/html", descBuffer.toString());
61 descPane.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
62 descPane.setEditable(false);
63 descPane.setOpaque(false);
64 descPane.setAlignmentX(JEditorPane.CENTER_ALIGNMENT);
66 mainPanel.add(descPane);
67 mainPanel.add(new JLabel(" "));
68 JButton okButton = new JButton(I18nManager.getText("button.ok"));
69 okButton.addActionListener(new ActionListener()
71 public void actionPerformed(ActionEvent e)
76 okButton.setAlignmentX(JButton.CENTER_ALIGNMENT);
77 mainPanel.add(okButton);