summaryrefslogtreecommitdiff
path: root/sources/simulator/VSAbout.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/simulator/VSAbout.java')
-rw-r--r--sources/simulator/VSAbout.java63
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();
+ }
+}