diff options
author | Robert Schuster <theBohemian@gmx.net> | 2006-03-06 15:42:45 +0000 |
---|---|---|
committer | Robert Schuster <theBohemian@gmx.net> | 2006-03-06 15:42:45 +0000 |
commit | aa080a9ad4ef9d18a6c4c2ae9fdf371574eec40d (patch) | |
tree | 568c7ca9ed88c700b997498c93a8511b451453eb /examples | |
parent | 539827cdddfcb6c3e66da69a72e2afad8747b1ae (diff) | |
download | classpath-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.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gnu/classpath/examples/swing/Demo.java | 25 |
1 files changed, 25 insertions, 0 deletions
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); |