home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-10-10 | 1.5 KB | 69 lines |
- // SystemVersionPanel.java
- //
- // Created 09/25/96
- //
- // (C)Copyright 1996 Microsoft Corporation, All rights reserved.
- //
-
- import java.awt.*;
- import java.util.*;
- import com.ms.util.*;
-
- public
- class SystemVersionPanel extends Panel
- {
- protected List items;
- protected VersionPanel verpanel;
-
- private void add (Component comp, GridBagConstraints constraints)
- {
- ((GridBagLayout)getLayout()).setConstraints(comp,constraints);
- super.add(comp);
- }
-
- public SystemVersionPanel ()
- {
- GridBagLayout grid = new GridBagLayout();
- setLayout(grid);
-
- GridBagConstraints c = new GridBagConstraints();
- c.fill = GridBagConstraints.BOTH;
- c.weightx = 1;
- c.weighty = 1;
-
- items = new List();
- add(items,c);
- verpanel = new VersionPanel();
- add(verpanel,c);
-
- Enumeration e;
- try
- {
- e = SystemVersionManager.enumerate();
- }
- catch (Throwable th)
- {
- // No system version manager
- return;
- }
-
- while (e.hasMoreElements())
- {
- String compname = (String)e.nextElement();
- items.addItem(compname);
- }
- }
-
- public boolean handleEvent (Event e)
- {
- if (e.id == Event.LIST_SELECT)
- {
- verpanel.changeInfo(SystemVersionManager.getSystemComponentVersion(items.getItem(items.getSelectedIndex())));
- return true;
- }
-
- return false;
- }
- }
-
-