summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schuster <theBohemian@gmx.net>2006-03-06 15:42:45 +0000
committerRobert Schuster <theBohemian@gmx.net>2006-03-06 15:42:45 +0000
commitaa080a9ad4ef9d18a6c4c2ae9fdf371574eec40d (patch)
tree568c7ca9ed88c700b997498c93a8511b451453eb
parent539827cdddfcb6c3e66da69a72e2afad8747b1ae (diff)
downloadclasspath-aa080a9ad4ef9d18a6c4c2ae9fdf371574eec40d.tar.gz
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.
-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);