summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--examples/gnu/classpath/examples/swing/Demo.java25
2 files changed, 31 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c6c5ca0c7..136678454 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-06 Robert Schuster <robertschuster@fsfe.org>
+
+ * examples/gnu/classpath/examples/swing/Demo.java:
+ (mkMenuBar): Added menu entry that will display the VM's name,
+ version and distributor.
+
2006-03-06 Tom Tromey <tromey@redhat.com>
* javax/swing/plaf/synth/SynthLookAndFeel.java (getDescription):
diff --git a/examples/gnu/classpath/examples/swing/Demo.java b/examples/gnu/classpath/examples/swing/Demo.java
index 7cb722668..b0604bb10 100644
--- a/examples/gnu/classpath/examples/swing/Demo.java
+++ b/examples/gnu/classpath/examples/swing/Demo.java
@@ -232,9 +232,34 @@ public class Demo
mkTable(),
examples);
+ final JMenuItem vmMenu;
+
help.add(new JMenuItem("just play with the widgets"));
help.add(new JMenuItem("and enjoy the sensation of"));
help.add(new JMenuItem("your neural connections growing"));
+ help.add(new JSeparator());
+ help.add(vmMenu = new JMenuItem("Really, which VM is this running on?"));
+ vmMenu.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ae)
+ {
+ String message = "This is "
+ + System.getProperty("java.vm.name")
+ + " Version "
+ + System.getProperty("java.vm.version")
+ + " distributed by "
+ + System.getProperty("java.vm.vendor");
+
+ String gnuClasspath = System.getProperty("gnu.classpath.version");
+ if(gnuClasspath != null)
+ message += "\nThe runtime's libraries are "
+ + "kindly provided by the "
+ + "members of GNU Classpath and are in version "
+ + gnuClasspath + ".";
+
+ JOptionPane.showMessageDialog(vmMenu, message);
+ }
+ });
bar.add(file);
bar.add(edit);