/* Testing the envioroment Java is running on! */ import java.applet.Applet; import java.awt.*; import java.util.Date; import java.util.Properties; public class Snapshot extends Applet { Font f1 = new Font("TimesRoman",Font.ITALIC,18); Font f2 = new Font("Helvetica",Font.PLAIN,12); public void init() { resize(450,300);} public void paint(Graphics g) { Dimension myAppletDim=size(); g.setColor(Color.black); g.drawRect(15,15,myAppletDim.width-30,myAppletDim.height-30); g.setColor(Color.white); g.fillRect(16,16,myAppletDim.width-32,myAppletDim.height-32); g.setColor(Color.lightGray); g.fillRect(30,30,myAppletDim.width-60,myAppletDim.height-60); g.setFont(f1); g.setColor(Color.black); g.drawString("Software Snapshot",135,60); g.setFont(f2); Date thisDay = new Date(); g.setColor(Color.blue); g.drawString("Current date and time:" + thisDay,50,100); g.setColor(Color.red); Properties myProperties = System.getProperties(); g.drawString("Java Home: "+myProperties.getProperty("java.home"), 50,140); g.drawString("Java Version: "+myProperties.getProperty("java.version"), 50,160); g.drawString("Browser: "+myProperties.getProperty("browser"), 50,180); g.setColor(Color.magenta); g.drawString("Operating System: "+myProperties.getProperty("os.name"), 50,220); g.drawString("OS Version: "+myProperties.getProperty("os.version"), 50,240); } }