diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-15 23:08:33 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-15 23:08:33 +0000 |
| commit | d4c1ddcc90c1e2e8660598fc36b3772d2bff6816 (patch) | |
| tree | 28a0afc255e42f92adbca0d102e785301bc43a58 /sources/simulator/VSAbout.java | |
| parent | 61599471a5978c1521b9c89c044ac2ce9a88c398 (diff) | |
1 Moved the stuff to trunk!
Diffstat (limited to 'sources/simulator/VSAbout.java')
| -rw-r--r-- | sources/simulator/VSAbout.java | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/sources/simulator/VSAbout.java b/sources/simulator/VSAbout.java new file mode 100644 index 0000000..4b68598 --- /dev/null +++ b/sources/simulator/VSAbout.java @@ -0,0 +1,63 @@ +package simulator; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.filechooser.*; +import java.util.*; +import java.io.File; + +import prefs.*; +import utils.*; + +public class VSAbout extends VSFrame implements ActionListener { + private VSPrefs prefs; + + public VSAbout(VSPrefs prefs, Component relativeTo) { + super(prefs.getString("name") + " - " + + prefs.getString("lang.about"), relativeTo); + + this.prefs = prefs; + disposeWithParent(); + setContentPane(createContentPane()); + setSize(350, 250); + setResizable(false); + setVisible(true); + } + + + public Container createContentPane() { + Container contentPane = getContentPane(); + + VSInfoArea infoArea = new VSInfoArea(prefs.getString("lang.about.info!")); + JPanel buttonPane = createButtonPane(); + JScrollPane scrollPane = new JScrollPane(infoArea); + + contentPane.add(scrollPane, BorderLayout.CENTER); + contentPane.add(buttonPane, BorderLayout.SOUTH); + + return contentPane; + } + + public JPanel createButtonPane() { + JPanel buttonPane = new JPanel(); + buttonPane.setBackground(Color.WHITE); + + JButton closeButton = new JButton( + prefs.getString("lang.close")); + closeButton.setMnemonic(prefs.getInteger("keyevent.close")); + closeButton.addActionListener(this); + buttonPane.add(closeButton); + + return buttonPane; + } + + + public void actionPerformed(ActionEvent e) { + String actionCommand = e.getActionCommand(); + + if (actionCommand.equals(prefs.getString("lang.close"))) + dispose(); + } +} |
