/Users/lyon/j4p/src/net/rmi/rmiimage/BCP.java

1    package net.rmi.rmiimage; 
2     
3    import java.awt.*; 
4    import java.awt.event.ActionEvent; 
5    import java.awt.event.ActionListener; 
6     
7    class BCP 
8        extends Panel implements ActionListener { 
9      Button updateButton = new Button("update"); 
10     Button terminateButton = new Button("terminate"); 
11     CPUArrayFrame display; 
12    
13     BCP(CPUArrayFrame _display) { 
14       display = _display; 
15       setBackground(Color.white); 
16       add(updateButton); 
17       add(terminateButton); 
18    
19       updateButton.addActionListener(this); 
20       terminateButton.addActionListener(this); 
21     } 
22    
23     public void actionPerformed(ActionEvent e) { 
24       if (e.getSource() == updateButton) { 
25         display.incrementCpus(); 
26         return; 
27       } 
28       if (e.getSource() == terminateButton) { 
29         display.terminateCpus(); 
30         return; 
31       } 
32     } 
33    
34   } 
35    
36    
37    
38