D:\NewZebra\JavaApplications\DesignPatternsProject\src\behavior_patterns\command_pattern_nested_menu\Two_Item_2.java
 1 /*
 2  * Two_Item_2.java 
 3  *
 4  * Disclaimer:
 5  * ZebraSoft.com disclaims all warrantees with regard to documents/programs, including 
 6  * all implied warranties. In no event shall ZebraSoft.com be liable for indirect or 
 7  * consequential damages or any damages whatsoever resulting from loss of use, data or 
 8  * profits arising out of the use of documents/programs.
 9  * 
10  * All content included on this site, such as text, graphics, logos, button icons, 
11  * images, audio clips, video clips, digital downloads, programs, data compilations, 
12  * and software, is the property of ZebraSoft.com or its content suppliers and 
13  * protected by United States and international copyright laws. 
14  *
15  * This site or any portion of this site may not be reproduced, duplicated, 
16  * copied, sold, resold, visited, or otherwise exploited for any commercial 
17  * purpose without express written consent of ZebraSoft.com.
18  */
19 
20 package behavior_patterns.command_pattern_nested_menu;
21 
22 /**
23  *
24  * @author Sam Eldin
25  */
26 
27 
28 import java.text.*;
29 import java.util.*;
30 import java.awt.event.*;
31 import java.awt.*;
32 import javax.swing.*;
33 
34     
35 public class Two_Item_2  implements Command {
36     
37     /** Creates a new instance of Two_Item_2 */
38     public Two_Item_2() {
39     }
40     /*
41      *
42      */
43     public void execute(CommandPanel passedCommandPanel){
44         if(passedCommandPanel != null) {
45             passedCommandPanel.removeAll();
46             passedCommandPanel.setBackground(Color.MAGENTA);
47             //--------------------------------------------
48             JLabel aJLabel = new JLabel("Two_Item_2");
49             aJLabel.setFont(new Font("TimesRoman", Font.BOLD, 20));
50             aJLabel.setBounds(200, 200, 250,30);
51             aJLabel.setForeground(Color.black);
52             passedCommandPanel.add(aJLabel);            
53         }
54         else
55             reportError();
56     }
57     /*
58      *
59      */
60     public void reportError(){
61             JOptionPane.showMessageDialog(null, "Two_Item_2 ", "Field Error", JOptionPane.ERROR_MESSAGE);        
62     }
63     
64 }
65 
66