import java.awt.*; import java.awt.event.*; /** A sample implementation of a command object. It opens a new window and shows some information about the system. */ public class TestCommand2 extends Command { public Frame frame; public void Execute() { frame = new Frame("Test Command 2"); frame.setLayout(new GridLayout(0,1)); frame.add(new Label("Java Runtime Environment Version: "+System.getProperty("java.version"),Label.CENTER)); frame.add(new Label("Operating System Name: "+System.getProperty("os.name"),Label.CENTER)); frame.add(new Label("Operating System Architecture: "+System.getProperty("os.arch"),Label.CENTER)); frame.add(new Label("Operating System Version: "+System.getProperty("os.version"),Label.CENTER)); frame.setSize(300,200); Button b = new Button("Close"); frame.add(b); b.addActionListener(new MyActionListener(frame)); frame.setVisible(true); } }