i need help

profileCarlos alzeri
khalaf.zip

Khalaf/.classpath

Khalaf/.project

Khalaf org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature

Khalaf/.settings/org.eclipse.jdt.core.prefs

eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.7

Khalaf/bin/StackDemo.KhalafStack1453995316712.html

Khalaf/bin/StackDemo.KhalafStack1453995269932.html

Khalaf/bin/java.policy.applet

/* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/ /* DO NOT EDIT */ grant { permission java.security.AllPermission; };

Khalaf/bin/StackModel/StackEdit.class

                package StackModel;

                public 
                abstract 
                synchronized 
                class StackEdit 
                extends javax.swing.undo.AbstractUndoableEdit {
    
                protected ArrayStack 
                model;
    
                public void StackEdit();
    
                public 
                abstract String 
                excute();
}

            

Khalaf/bin/StackModel/StackADT.class

                package StackModel;

                public 
                abstract 
                interface StackADT {
    
                public 
                abstract void 
                push(Object);
    
                public 
                abstract Object 
                pop();
    
                public 
                abstract Object 
                peek();
    
                public 
                abstract boolean 
                isEmpty();
    
                public 
                abstract int 
                size();
    
                public 
                abstract String 
                toString();
}

            

Khalaf/bin/StackModel/PushEdit.class

                package StackModel;

                public 
                synchronized 
                class PushEdit 
                extends StackEdit {
    
                private String 
                input;
    
                public void PushEdit(ArrayStack, String);
    
                public String 
                excute();
    
                public void 
                redo() 
                throws javax.swing.undo.CannotRedoException;
    
                public void 
                undo() 
                throws javax.swing.undo.CannotUndoException;
}

            

Khalaf/bin/StackModel/PopEdit.class

                package StackModel;

                public 
                synchronized 
                class PopEdit 
                extends StackEdit {
    String 
                popped;
    
                public void PopEdit(ArrayStack);
    
                public String 
                excute();
    
                public void 
                redo() 
                throws javax.swing.undo.CannotRedoException;
    
                public void 
                undo() 
                throws javax.swing.undo.CannotUndoException;
}

            

Khalaf/bin/StackModel/ArrayStack.class

                package StackModel;

                public 
                synchronized 
                class ArrayStack 
                implements StackADT {
    
                private 
                final int 
                DEFAULT_CAPACITY;
    
                private int 
                top;
    
                private Object[] 
                stack;
    
                public void ArrayStack();
    
                public void ArrayStack(int);
    
                public void 
                push(Object);
    
                public Object 
                pop() 
                throws exception.EmptyCollectionException;
    
                public Object 
                peek() 
                throws exception.EmptyCollectionException;
    
                public boolean 
                isEmpty();
    
                public int 
                size();
    
                public String 
                toString();
    
                private void 
                expandCapacity();
    void 
                pop(String);
    void 
                push();
}

            

Khalaf/bin/StackDemo/KhalafStack$15.class

                package StackDemo;

                synchronized 
                class KhalafStack$15 
                implements java.awt.event.ActionListener {
    void KhalafStack$15(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$2.class

                package StackDemo;

                synchronized 
                class KhalafStack$2 
                implements java.awt.event.ActionListener {
    void KhalafStack$2(KhalafStack, String);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$11.class

                package StackDemo;

                synchronized 
                class KhalafStack$11 
                implements java.awt.event.ActionListener {
    void KhalafStack$11(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$8.class

                package StackDemo;

                synchronized 
                class KhalafStack$8 
                implements java.awt.event.ActionListener {
    void KhalafStack$8(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$4.class

                package StackDemo;

                synchronized 
                class KhalafStack$4 
                implements java.awt.event.ActionListener {
    void KhalafStack$4(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$3.class

                package StackDemo;

                synchronized 
                class KhalafStack$3 
                extends java.awt.event.KeyAdapter {
    void KhalafStack$3(KhalafStack);
    
                public void 
                keyTyped(java.awt.event.KeyEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack.class

                package StackDemo;

                public 
                synchronized 
                class KhalafStack 
                extends javax.swing.JApplet {
    
                private javax.swing.undo.UndoManager 
                undoManager;
    
                private StackModel.ArrayStack 
                myStack;
    
                private javax.swing.JMenuItem 
                aboutMenu;
    
                private javax.swing.JLabel 
                addLabel;
    
                private javax.swing.JCheckBoxMenuItem 
                arabicMenu;
    
                private javax.swing.JCheckBoxMenuItem 
                boldMenu;
    
                private javax.swing.JMenu 
                changeLangMenu;
    
                private javax.swing.JTextArea 
                contentTextArea;
    
                private javax.swing.JMenuItem 
                decreaseMenu;
    
                private javax.swing.JMenu 
                editMenu;
    
                private javax.swing.JButton 
                emptyButton;
    
                private javax.swing.JRadioButtonMenuItem 
                englishMenu;
    
                private javax.swing.JMenu 
                fileMenu;
    
                private javax.swing.JMenu 
                fontMenu;
    
                private javax.swing.JMenu 
                fontSizeMenu;
    
                private javax.swing.JMenu 
                fontStyleMenu;
    
                private javax.swing.JMenu 
                helpMenu;
    
                private javax.swing.JMenuItem 
                increaseMenu;
    
                private javax.swing.JTextField 
                inputTextField;
    
                private javax.swing.JCheckBoxMenuItem 
                italicMenu;
    
                private javax.swing.JScrollPane 
                jScrollPane1;
    
                private javax.swing.JScrollPane 
                jScrollPane2;
    
                private javax.swing.JTextArea 
                logTextArea;
    
                private javax.swing.JMenuBar 
                menuBar;
    
                private javax.swing.JButton 
                peekButton;
    
                private javax.swing.JButton 
                popButton;
    
                private javax.swing.JButton 
                pushButton;
    
                private javax.swing.JMenuItem 
                redoMenu;
    
                private javax.swing.JButton 
                sizeButton;
    
                private javax.swing.JCheckBoxMenuItem 
                spanishMenu;
    
                private javax.swing.JCheckBoxMenuItem 
                swedishMenu;
    
                private javax.swing.JMenuItem 
                tutorialMenu;
    
                private javax.swing.JMenuItem 
                undoMenu;
    
                private String 
                fontID;
    
                private int 
                fontStyle;
    
                private int 
                fontSize;
    
                private String 
                language;
    
                public void KhalafStack();
    
                public void 
                init();
    
                private void 
                customeInit();
    
                private void 
                setBtnStatus();
    
                private boolean 
                canRedo();
    
                public void 
                setCurrentFont(String);
    
                private void 
                initComponents();
    
                private void 
                pushButtonActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                popButtonActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                spanishMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                undoMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                redoMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                boldMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                italicMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                increaseMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                decreaseMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                englishMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                swedishMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                arabicMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                tutorialMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                aboutMenuActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                peekButtonActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                sizeButtonActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                emptyButtonActionPerformed(java.awt.event.ActionEvent);
    
                private void 
                KeyTyped(java.awt.event.KeyEvent);
    
                private void 
                bindFont();
    
                private void 
                bindLanguage();
}

            

Khalaf/bin/StackDemo/KhalafStack$13.class

                package StackDemo;

                synchronized 
                class KhalafStack$13 
                implements java.awt.event.ActionListener {
    void KhalafStack$13(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$6.class

                package StackDemo;

                synchronized 
                class KhalafStack$6 
                implements java.awt.event.ActionListener {
    void KhalafStack$6(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$1.class

                package StackDemo;

                synchronized 
                class KhalafStack$1 
                implements Runnable {
    void KhalafStack$1(KhalafStack);
    
                public void 
                run();
}

            

Khalaf/bin/StackDemo/KhalafStack$19.class

                package StackDemo;

                synchronized 
                class KhalafStack$19 
                implements java.awt.event.ActionListener {
    void KhalafStack$19(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$7.class

                package StackDemo;

                synchronized 
                class KhalafStack$7 
                implements java.awt.event.ActionListener {
    void KhalafStack$7(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$9.class

                package StackDemo;

                synchronized 
                class KhalafStack$9 
                implements java.awt.event.ActionListener {
    void KhalafStack$9(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$14.class

                package StackDemo;

                synchronized 
                class KhalafStack$14 
                implements java.awt.event.ActionListener {
    void KhalafStack$14(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$12.class

                package StackDemo;

                synchronized 
                class KhalafStack$12 
                implements java.awt.event.ActionListener {
    void KhalafStack$12(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$18.class

                package StackDemo;

                synchronized 
                class KhalafStack$18 
                implements java.awt.event.ActionListener {
    void KhalafStack$18(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$16.class

                package StackDemo;

                synchronized 
                class KhalafStack$16 
                implements java.awt.event.ActionListener {
    void KhalafStack$16(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$17.class

                package StackDemo;

                synchronized 
                class KhalafStack$17 
                implements java.awt.event.ActionListener {
    void KhalafStack$17(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$20.class

                package StackDemo;

                synchronized 
                class KhalafStack$20 
                implements java.awt.event.ActionListener {
    void KhalafStack$20(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$10.class

                package StackDemo;

                synchronized 
                class KhalafStack$10 
                implements java.awt.event.ActionListener {
    void KhalafStack$10(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/bin/StackDemo/KhalafStack$5.class

                package StackDemo;

                synchronized 
                class KhalafStack$5 
                implements java.awt.event.ActionListener {
    void KhalafStack$5(KhalafStack);
    
                public void 
                actionPerformed(java.awt.event.ActionEvent);
}

            

Khalaf/src/StackModel/StackEdit.java

Khalaf/src/StackModel/StackEdit.java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package   StackModel ;

import  javax . swing . undo . AbstractUndoableEdit ;

/**
 *
 *  @author  Yousef
 */
public   abstract   class   StackEdit   extends   AbstractUndoableEdit   {
     protected   ArrayStack < String >  model = null ;
     public   abstract   String  excute ();
    
     }

Khalaf/src/StackModel/StackADT.java

Khalaf/src/StackModel/StackADT.java

package   StackModel ;
/**
 *   @author  Lewis and Chase
 *
 *  Defines the interface to a stack data structure.
 */


public   interface   StackADT < T >
{
   /**  Adds one element to the top of this stack. 
   *    @param  element element to be pushed onto stack
   */
   public   void  push  ( T element );
  
   /**  Removes and returns the top element from this stack. 
   *    @return  T element removed from the top of the stack
   */
   public  T pop ();

   /**  Returns without removing the top element of this stack. 
   *    @return  T element on top of the stack
   */
   public  T peek ();
  
   /**  Returns true if this stack contains no elements. 
   *    @return  boolean whether or not this stack is empty
   */
   public   boolean  isEmpty ();

   /**  Returns the number of elements in this stack. 
   *    @return  int number of elements in this stack
   */
   public   int  size ();

   /**  Returns a string representation of this stack. 
   *    @return  String representation of this stack
   */
   public   String  toString ();
}

Khalaf/src/StackModel/PushEdit.java

Khalaf/src/StackModel/PushEdit.java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package   StackModel ;

import  javax . swing . undo . CannotRedoException ;
import  javax . swing . undo . CannotUndoException ;

/**
 *
 *  @author  yousef
 */
public   class   PushEdit   extends   StackEdit {
    
     private   String  input ;
    
     public   PushEdit   ( ArrayStack < String >  iniModel ,   String  iniInput ){
       input  = iniInput ;
       model  =  iniModel ;
      
     }
    
    @ Override
     public   String  excute (){
       model . push ( input );
        return   null ;
     }
    
     public   void  redo ()   throws   CannotRedoException {
    
            model . push ( input );
     }

     public   void  undo ()   throws   CannotUndoException {
         if ( ! model . isEmpty ())
        model . pop ();
     }
   }

Khalaf/src/StackModel/PopEdit.java

Khalaf/src/StackModel/PopEdit.java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package   StackModel ;

import  javax . swing . undo . CannotRedoException ;
import  javax . swing . undo . CannotUndoException ;

/**
 *
 *  @author  yousef
 */
public   class   PopEdit   extends   StackEdit {
     //  private final String input;
       String  popped ;
     public   PopEdit ( ArrayStack < String >  iniModel )   {
         model  =  iniModel ;
     }
    
   
    
    @ Override
     public   String  excute (){
      popped =  model . pop ();
       return  popped ;
     }
    
    
     public   void  redo ()   throws   CannotRedoException {
     if ( ! model . isEmpty ())
     {
        model . pop ();
     }
}    
     public   void  undo ()   throws   CannotUndoException {
        // if(!model.isEmpty())
        model . push ( popped );
     }
    
}

Khalaf/src/StackModel/ArrayStack.java

Khalaf/src/StackModel/ArrayStack.java

package   StackModel ;

import   StackModel . exception . EmptyCollectionException ;

/**
 *  @author  Lewis and Chase
 * 
 *         Represents an array implementation of a stack.
 */

public   class   ArrayStack < T >   implements   StackADT < T >   {
     /**
     * constant to represent the default capacity of the array
     */
     private   final   int  DEFAULT_CAPACITY = 100 ; //add

     /**
     * int that represents both the number of elements and the next available
     * position in the array
     */
     private   int  top ;

     /**
     * array of generic elements to represent the stack
     */
     private  T []  stack ;

     /**
     * Creates an empty stack using the default capacity.
     */
     public   ArrayStack ()   {
        top  =   0 ;
        stack  =   ( T [])   ( new   Object [ DEFAULT_CAPACITY ]);
     }

     /**
     * Creates an empty stack using the specified capacity.
     * 
     *  @param  initialCapacity
     *            represents the specified capacity
     */
     public   ArrayStack ( int  initialCapacity )   {
        top  =   0 ;
        stack  =   ( T [])   ( new   Object [ initialCapacity ]);
     }

     /**
     * Adds the specified element to the top of this stack, expanding the
     * capacity of the stack array if necessary.
     * 
     *  @param  element
     *            generic element to be pushed onto stack
     */
     public   void  push ( T element )   {
           

         // the incoming element should be stored in the top of the stack
             if   ( size ()   ==  stack . length )
                 { expandCapacity ();}
             stack [ top ++ ]   =  element ;
         // the top counter should be incremented to show the top has moved up
             
     }

     /**
     * Removes the element at the top of this stack and returns a reference to
     * it. Throws an EmptyCollectionException if the stack is empty.
     * 
     *  @return  T element removed from top of stack
     *  @throws  EmptyCollectionException
     *             if a pop is attempted on empty stack
     */
     public  T pop ()   throws   EmptyCollectionException   {
         if   ( isEmpty ())
             throw   new   EmptyCollectionException ( "Stack" );

        
        T result  =  stack [ -- top ];
        stack [ top ]   =   null ;

         return  result ;
     }
        

     /**
     * Returns a reference to the element at the top of this stack. The element
     * is not removed from the stack. Throws an EmptyCollectionException if the
     * stack is empty.
     * 
     *  @return  T element on top of stack
     *  @throws  EmptyCollectionException
     *             if a peek is attempted on empty stack
     */
     public  T peek ()   throws   EmptyCollectionException      //add
    
     {
         if   ( isEmpty ())
             { throw   new   EmptyCollectionException ( "Stack" );}

         return  stack [ top  -   1 ];
     }

     /**
     * Returns true if this stack is empty and false otherwise.
     * 
     *  @return  boolean true if this stack is empty, false otherwise
     */
     public   boolean  isEmpty ()   {
         if   ( top == 0 )
             return   true ;
         else
             return   false ;
     }

     /**
     * Returns the number of elements in this stack.
     * 
     *  @return  int the number of elements in this stack
     */
     public   int  size ()   {
         return  top ;
     }

     /**
     * Returns a string representation of this stack.
     * 
     *  @return  String representation of this stack
     */
     public   String  toString ()   {
         String  result  =   "" ;

         for   ( int  scan  =   0 ;  scan  <  top ;  scan ++ )
            result  =  result  +  stack [ scan ]. toString ()   +   "\n" ;

         return  result ;
     }

     /**
     * Creates a new array to store the contents of this stack with twice the
     * capacity of the old one.
     */
     private   void  expandCapacity ()   {
        T []  larger  =   ( T [])   ( new   Object [ stack . length  *   2 ]);

         for   ( int  index  =   0 ;  index  <  stack . length ;  index ++ )
            larger [ index ]   =  stack [ index ];

        stack  =  larger ;
     }

     void  pop ( String  input )   {
         throw   new   UnsupportedOperationException ( "Not supported yet." );   //To change body of generated methods, choose Tools | Templates.
     }

     void  push ()   {
         throw   new   UnsupportedOperationException ( "Not supported yet." );   //To change body of generated methods, choose Tools | Templates.
     }
}

Khalaf/src/StackDemo/KhalafStack.java

Khalaf/src/StackDemo/KhalafStack.java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package   StackDemo ;

import   StackModel . ArrayStack ;
import   StackModel . PopEdit ;
import   StackModel . PushEdit ;
import  java . awt . Container ;
import  java . awt . Font ;
import  java . awt . Frame ;
import  java . awt . GraphicsEnvironment ;
import  java . awt . event . ActionEvent ;
import  java . awt . event . ActionListener ;
import  java . awt . event . KeyEvent ;
import  java . util . Locale ;
import  javax . swing . ImageIcon ;
import  javax . swing . JMenuItem ;
import  javax . swing . JOptionPane ;
import   static  javax . swing . JOptionPane . INFORMATION_MESSAGE ;
import  javax . swing . undo . UndoManager ;

/**
 *
 *  @author  Khalaf
 */
public   class   KhalafStack   extends  javax . swing . JApplet   {

     /**
     * Initializes the applet KhalafStack
     */
    @ Override
     public   void  init ()   {
        
         /* Set the Nimbus look and feel */
         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
         try   {
             for   ( javax . swing . UIManager . LookAndFeelInfo  info  :  javax . swing . UIManager . getInstalledLookAndFeels ())   {
                 if   ( "Nimbus" . equals ( info . getName ()))   {
                    javax . swing . UIManager . setLookAndFeel ( info . getClassName ());
                     break ;
                 }
             }
         }   catch   ( ClassNotFoundException  ex )   {
            java . util . logging . Logger . getLogger ( KhalafStack . class . getName ()). log ( java . util . logging . Level . SEVERE ,   null ,  ex );
         }   catch   ( InstantiationException  ex )   {
            java . util . logging . Logger . getLogger ( KhalafStack . class . getName ()). log ( java . util . logging . Level . SEVERE ,   null ,  ex );
         }   catch   ( IllegalAccessException  ex )   {
            java . util . logging . Logger . getLogger ( KhalafStack . class . getName ()). log ( java . util . logging . Level . SEVERE ,   null ,  ex );
         }   catch   ( javax . swing . UnsupportedLookAndFeelException  ex )   {
            java . util . logging . Logger . getLogger ( KhalafStack . class . getName ()). log ( java . util . logging . Level . SEVERE ,   null ,  ex );
         }
         //</editor-fold>

         /* Create and display the applet */
         try   {
            java . awt . EventQueue . invokeAndWait ( new   Runnable ()   {
                 public   void  run ()   {
                    initComponents ();
                    customeInit ();
                 }
             });
         }   catch   ( Exception  ex )   {
            ex . printStackTrace ();
         }
        
     }

     private   void  customeInit ()   {
        setBtnStatus ();
        popButton . setEnabled ( false );
         String []  fonts  =   new   String []{ "Arial" ,   "Times New Roman" ,   "David" ,   "Arial Black" };
         for   ( final   String  fName  : fonts )   {
             JMenuItem  fMenu  =   new   JMenuItem ( fName );
            fMenu . addActionListener ( new   ActionListener ()   {

                @ Override
                 public   void  actionPerformed ( ActionEvent  e )   {
                    setCurrentFont ( fName );
                 }
             });
            fontMenu . add ( fMenu );
         }
         this . fontID  =  pushButton . getFont (). getFontName ();
         this . fontStyle  =  pushButton . getFont (). getStyle ();
         this . fontSize  =  pushButton . getFont (). getSize ();
        
     }
    
     private   void  setBtnStatus (){
    undoMenu . setEnabled ( undoManager . canUndo ());
    redoMenu . setEnabled ( canRedo ());
    pushButton . setEnabled ( inputTextField . getText () == "" );
    popButton . setEnabled ( ! myStack . isEmpty ());
    peekButton . setEnabled ( ! myStack . isEmpty ());
     }
    
  
     private   boolean  canRedo (){
         try {
            undoManager . redo ();
            undoManager . undo ();
         }
         catch ( Exception  ex ){
         return   false ;
         }
         return   true ;
     }
            
     public   void  setCurrentFont ( String  fontName )   {
         this . fontID  =  fontName ;
        bindFont ();
     }

   
    @ SuppressWarnings ( "unchecked" )
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
     private   void  initComponents ()   {

        jScrollPane1  =   new  javax . swing . JScrollPane ();
        contentTextArea  =   new  javax . swing . JTextArea ();
        inputTextField  =   new  javax . swing . JTextField ();
        addLabel  =   new  javax . swing . JLabel ();
        pushButton  =   new  javax . swing . JButton ();
        popButton  =   new  javax . swing . JButton ();
        jScrollPane2  =   new  javax . swing . JScrollPane ();
        logTextArea  =   new  javax . swing . JTextArea ();
        peekButton  =   new  javax . swing . JButton ();
        sizeButton  =   new  javax . swing . JButton ();
        emptyButton  =   new  javax . swing . JButton ();
        menuBar  =   new  javax . swing . JMenuBar ();
        fileMenu  =   new  javax . swing . JMenu ();
        changeLangMenu  =   new  javax . swing . JMenu ();
        englishMenu  =   new  javax . swing . JRadioButtonMenuItem ();
        spanishMenu  =   new  javax . swing . JCheckBoxMenuItem ();
        swedishMenu  =   new  javax . swing . JCheckBoxMenuItem ();
        arabicMenu  =   new  javax . swing . JCheckBoxMenuItem ();
        editMenu  =   new  javax . swing . JMenu ();
        undoMenu  =   new  javax . swing . JMenuItem ();
        redoMenu  =   new  javax . swing . JMenuItem ();
        fontMenu  =   new  javax . swing . JMenu ();
        fontStyleMenu  =   new  javax . swing . JMenu ();
        boldMenu  =   new  javax . swing . JCheckBoxMenuItem ();
        italicMenu  =   new  javax . swing . JCheckBoxMenuItem ();
        fontSizeMenu  =   new  javax . swing . JMenu ();
        increaseMenu  =   new  javax . swing . JMenuItem ();
        decreaseMenu  =   new  javax . swing . JMenuItem ();
        helpMenu  =   new  javax . swing . JMenu ();
        tutorialMenu  =   new  javax . swing . JMenuItem ();
        aboutMenu  =   new  javax . swing . JMenuItem ();

        contentTextArea . setEditable ( false );
        contentTextArea . setBackground ( new  java . awt . Color ( 153 ,   153 ,   255 ));
        contentTextArea . setColumns ( 20 );
        contentTextArea . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        contentTextArea . setRows ( 5 );
        contentTextArea . setToolTipText ( "Display stack elements" );
        contentTextArea . setBorder ( new  javax . swing . border . MatteBorder ( null ));
        jScrollPane1 . setViewportView ( contentTextArea );

        inputTextField . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        inputTextField . setForeground ( new  java . awt . Color ( 204 ,   0 ,   0 ));
        inputTextField . setToolTipText ( "The text that you want to push to the stack" );
        inputTextField . setBorder ( new  javax . swing . border . MatteBorder ( null ));
        inputTextField . addKeyListener ( new  java . awt . event . KeyAdapter ()   {
             public   void  keyTyped ( java . awt . event . KeyEvent  evt )   {
                 KeyTyped ( evt );
             }
         });

        addLabel . setBackground ( new  java . awt . Color ( 153 ,   153 ,   255 ));
        addLabel . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        java . util . ResourceBundle  bundle  =  java . util . ResourceBundle . getBundle ( "StackDemo/language" );   // NOI18N
        addLabel . setText ( bundle . getString ( "addtoStack" ));   // NOI18N
        addLabel . setBorder ( new  javax . swing . border . MatteBorder ( null ));
        addLabel . setOpaque ( true );

        pushButton . setBackground ( new  java . awt . Color ( 255 ,   204 ,   153 ));
        pushButton . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        pushButton . setMnemonic ( KeyEvent . VK_ENTER );
        pushButton . setText ( bundle . getString ( "push" ));   // NOI18N
        pushButton . setToolTipText ( "Click \"Push\" to push an element in the stack\n or Press Alt+Enter" );
        pushButton . setBorder ( javax . swing . BorderFactory . createLineBorder ( new  java . awt . Color ( 0 ,   0 ,   0 )));
        pushButton . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                pushButtonActionPerformed ( evt );
             }
         });

        popButton . setBackground ( new  java . awt . Color ( 255 ,   204 ,   153 ));
        popButton . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        popButton . setMnemonic ( KeyEvent . VK_P );
        popButton . setText ( bundle . getString ( "pop" ));   // NOI18N
        popButton . setToolTipText ( "Click \"Pop\" to pop an element from the stack \nor press Alt+P" );
        popButton . setActionCommand ( "" );
        popButton . setBorder ( javax . swing . BorderFactory . createLineBorder ( new  java . awt . Color ( 0 ,   0 ,   0 )));
        popButton . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                popButtonActionPerformed ( evt );
             }
         });

        logTextArea . setEditable ( false );
        logTextArea . setBackground ( new  java . awt . Color ( 204 ,   255 ,   204 ));
        logTextArea . setColumns ( 20 );
        logTextArea . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        logTextArea . setForeground ( new  java . awt . Color ( 51 ,   51 ,   255 ));
        logTextArea . setRows ( 5 );
        logTextArea . setToolTipText ( "The action that you did on the stack" );
        logTextArea . setBorder ( new  javax . swing . border . MatteBorder ( null ));
        jScrollPane2 . setViewportView ( logTextArea );

        peekButton . setBackground ( new  java . awt . Color ( 255 ,   204 ,   153 ));
        peekButton . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        peekButton . setMnemonic ( KeyEvent . VK_K );
        peekButton . setText ( "Peek" );
        peekButton . setToolTipText ( "Click \"Peek\" to see the the top elemnt in the stack or press ALT+K" );
        peekButton . setBorder ( javax . swing . BorderFactory . createLineBorder ( new  java . awt . Color ( 0 ,   0 ,   0 )));
        peekButton . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                peekButtonActionPerformed ( evt );
             }
         });

        sizeButton . setBackground ( new  java . awt . Color ( 255 ,   204 ,   153 ));
        sizeButton . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        sizeButton . setMnemonic ( KeyEvent . VK_S );
        sizeButton . setText ( "Size" );
        sizeButton . setToolTipText ( "Click \"size\" to see the size of the stack or press Alt+S" );
        sizeButton . setBorder ( javax . swing . BorderFactory . createLineBorder ( new  java . awt . Color ( 0 ,   0 ,   0 )));
        sizeButton . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                sizeButtonActionPerformed ( evt );
             }
         });

        emptyButton . setBackground ( new  java . awt . Color ( 255 ,   204 ,   153 ));
        emptyButton . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        emptyButton . setMnemonic ( KeyEvent . VK_M );
        emptyButton . setText ( "Is empty?" );
        emptyButton . setToolTipText ( "Click \"Is empty?\" to see if the stack is empty or not . You may Press Alt+M to run this button" );
        emptyButton . setBorder ( javax . swing . BorderFactory . createLineBorder ( new  java . awt . Color ( 0 ,   0 ,   0 )));
        emptyButton . setBorderPainted ( false );
        emptyButton . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                emptyButtonActionPerformed ( evt );
             }
         });

        fileMenu . setText ( bundle . getString ( "file" ));   // NOI18N

        changeLangMenu . setText ( bundle . getString ( "changelanguage" ));   // NOI18N

        englishMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_E ,  java . awt . event . InputEvent . CTRL_MASK ));
        englishMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        englishMenu . setSelected ( true );
        englishMenu . setText ( bundle . getString ( "English" ));   // NOI18N
        englishMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                englishMenuActionPerformed ( evt );
             }
         });
        changeLangMenu . add ( englishMenu );

        spanishMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_S ,  java . awt . event . InputEvent . CTRL_MASK ));
        spanishMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        spanishMenu . setText ( bundle . getString ( "Spanish" ));   // NOI18N
        spanishMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                spanishMenuActionPerformed ( evt );
             }
         });
        changeLangMenu . add ( spanishMenu );

        swedishMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_W ,  java . awt . event . InputEvent . CTRL_MASK ));
        swedishMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        swedishMenu . setText ( "Swedish" );
        swedishMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                swedishMenuActionPerformed ( evt );
             }
         });
        changeLangMenu . add ( swedishMenu );

        arabicMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_R ,  java . awt . event . InputEvent . CTRL_MASK ));
        arabicMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        arabicMenu . setText ( bundle . getString ( "Arabic" ));   // NOI18N
        arabicMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                arabicMenuActionPerformed ( evt );
             }
         });
        changeLangMenu . add ( arabicMenu );

        fileMenu . add ( changeLangMenu );

        menuBar . add ( fileMenu );

        editMenu . setText ( bundle . getString ( "edit" ));   // NOI18N

        undoMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_Z ,  java . awt . event . InputEvent . CTRL_MASK ));
        undoMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        undoMenu . setText ( bundle . getString ( "undo" ));   // NOI18N
        undoMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                undoMenuActionPerformed ( evt );
             }
         });
        editMenu . add ( undoMenu );

        redoMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_Y ,  java . awt . event . InputEvent . CTRL_MASK ));
        redoMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        redoMenu . setText ( bundle . getString ( "redo" ));   // NOI18N
        redoMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                redoMenuActionPerformed ( evt );
             }
         });
        editMenu . add ( redoMenu );

        fontMenu . setText ( bundle . getString ( "Font" ));   // NOI18N
        editMenu . add ( fontMenu );

        fontStyleMenu . setText ( bundle . getString ( "fontStyle" ));   // NOI18N

        boldMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_B ,  java . awt . event . InputEvent . ALT_MASK ));
        boldMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        boldMenu . setSelected ( true );
        boldMenu . setText ( bundle . getString ( "Bold" ));   // NOI18N
        boldMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                boldMenuActionPerformed ( evt );
             }
         });
        fontStyleMenu . add ( boldMenu );

        italicMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_I ,  java . awt . event . InputEvent . ALT_MASK ));
        italicMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        italicMenu . setSelected ( true );
        italicMenu . setText ( bundle . getString ( "Italic" ));   // NOI18N
        italicMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                italicMenuActionPerformed ( evt );
             }
         });
        fontStyleMenu . add ( italicMenu );

        editMenu . add ( fontStyleMenu );

        fontSizeMenu . setText ( bundle . getString ( "fontsize" ));   // NOI18N

        increaseMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_ADD ,  java . awt . event . InputEvent . ALT_MASK ));
        increaseMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        increaseMenu . setText ( bundle . getString ( "Increase" ));   // NOI18N
        increaseMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                increaseMenuActionPerformed ( evt );
             }
         });
        fontSizeMenu . add ( increaseMenu );

        decreaseMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_SUBTRACT ,  java . awt . event . InputEvent . ALT_MASK ));
        decreaseMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        decreaseMenu . setText ( bundle . getString ( "Decrease" ));   // NOI18N
        decreaseMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                decreaseMenuActionPerformed ( evt );
             }
         });
        fontSizeMenu . add ( decreaseMenu );

        editMenu . add ( fontSizeMenu );

        menuBar . add ( editMenu );

        helpMenu . setText ( bundle . getString ( "help" ));   // NOI18N

        tutorialMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_T ,  java . awt . event . InputEvent . ALT_MASK ));
        tutorialMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        tutorialMenu . setText ( bundle . getString ( "Tutorial" ));   // NOI18N
        tutorialMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                tutorialMenuActionPerformed ( evt );
             }
         });
        helpMenu . add ( tutorialMenu );

        aboutMenu . setAccelerator ( javax . swing . KeyStroke . getKeyStroke ( java . awt . event . KeyEvent . VK_A ,  java . awt . event . InputEvent . ALT_MASK ));
        aboutMenu . setFont ( new  java . awt . Font ( "Times New Roman" ,   0 ,   14 ));   // NOI18N
        aboutMenu . setText ( bundle . getString ( "About" ));   // NOI18N
        aboutMenu . addActionListener ( new  java . awt . event . ActionListener ()   {
             public   void  actionPerformed ( java . awt . event . ActionEvent  evt )   {
                aboutMenuActionPerformed ( evt );
             }
         });
        helpMenu . add ( aboutMenu );

        menuBar . add ( helpMenu );

        setJMenuBar ( menuBar );

        javax . swing . GroupLayout  layout  =   new  javax . swing . GroupLayout ( getContentPane ());
        getContentPane (). setLayout ( layout );
        layout . setHorizontalGroup (
            layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
             . addGroup ( layout . createSequentialGroup ()
                 . addContainerGap ()
                 . addGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ,   false )
                     . addGroup ( layout . createSequentialGroup ()
                         . addComponent ( pushButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   65 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                         . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
                         . addComponent ( popButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   71 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                         . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UNRELATED )
                         . addComponent ( peekButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   63 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                         . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
                         . addComponent ( sizeButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   63 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                         . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UNRELATED )
                         . addComponent ( emptyButton ,  javax . swing . GroupLayout . DEFAULT_SIZE ,   115 ,   Short . MAX_VALUE ))
                     . addComponent ( jScrollPane1 )
                     . addGroup ( layout . createSequentialGroup ()
                         . addComponent ( addLabel ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   109 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                         . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UNRELATED )
                         . addComponent ( inputTextField ))
                     . addComponent ( jScrollPane2 ))
                 . addContainerGap ( 23 ,   Short . MAX_VALUE ))
         );
        layout . setVerticalGroup (
            layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING )
             . addGroup ( layout . createSequentialGroup ()
                 . addContainerGap ()
                 . addComponent ( jScrollPane1 ,  javax . swing . GroupLayout . PREFERRED_SIZE ,  javax . swing . GroupLayout . DEFAULT_SIZE ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                 . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
                 . addGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ,   false )
                     . addComponent ( inputTextField ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   37 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                     . addComponent ( addLabel ,  javax . swing . GroupLayout . DEFAULT_SIZE ,  javax . swing . GroupLayout . DEFAULT_SIZE ,   Short . MAX_VALUE ))
                 . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
                 . addComponent ( jScrollPane2 ,  javax . swing . GroupLayout . PREFERRED_SIZE ,  javax . swing . GroupLayout . DEFAULT_SIZE ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                 . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED )
                 . addGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE )
                     . addComponent ( pushButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   32 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                     . addComponent ( peekButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   32 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                     . addComponent ( sizeButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   32 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                     . addComponent ( emptyButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   32 ,  javax . swing . GroupLayout . PREFERRED_SIZE )
                     . addComponent ( popButton ,  javax . swing . GroupLayout . PREFERRED_SIZE ,   32 ,  javax . swing . GroupLayout . PREFERRED_SIZE ))
                 . addGap ( 70 ,   70 ,   70 ))
         );
     } // </editor-fold>//GEN-END:initComponents

     private   void  pushButtonActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_pushButtonActionPerformed
         String  toPush  =  inputTextField . getText (). trim ();
         if   ( toPush . length ()   !=   0 )   {

             PushEdit  edit  =   new   PushEdit ( myStack ,  toPush );
            edit . excute ();
            undoManager . addEdit ( edit );
            contentTextArea . setText ( myStack . toString ());
            contentTextArea . setCaretPosition ( 0 );
            inputTextField . setText ( null );
            inputTextField . requestFocus ();

//log
            logTextArea . append ( "<< "   +  toPush  +   " >> was pushed into the stack \n" );
         }  
        setBtnStatus ();
       
     } //GEN-LAST:event_pushButtonActionPerformed

     private   void  popButtonActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_popButtonActionPerformed
         if   ( ! myStack . isEmpty ())   {

             PopEdit  edit  =   new   PopEdit ( myStack );
             String  popped  =  edit . excute ();
            undoManager . addEdit ( edit );
            contentTextArea . setText ( myStack . toString ());
            contentTextArea . setCaretPosition ( 0 );
            inputTextField . setText ( null );
            inputTextField . requestFocus ();

            logTextArea . append ( "<< "   +  popped  +   " >> was popped off the stack\n" );
         }  
        setBtnStatus ();
     } //GEN-LAST:event_popButtonActionPerformed
                                     

     private   void  spanishMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_spanishMenuActionPerformed
         if   ( spanishMenu . isSelected ())   {
            language  =   "language_es.properties" ;
            swedishMenu . setSelected ( false );
            englishMenu . setSelected ( false );
            arabicMenu . setSelected ( false );
         }
         if   ( ! englishMenu . isSelected ()   &&   ! swedishMenu . isSelected ()   &&   ! spanishMenu . isSelected ()   &&   ! arabicMenu . isSelected ())   {
            language  =   "language.properties" ;
            englishMenu . setSelected ( true );
         }

        bindLanguage ();
     } //GEN-LAST:event_spanishMenuActionPerformed

     private   void  undoMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_undoMenuActionPerformed
        if ( undoManager . canUndo ())
        {
            undoManager . undo ();
            logTextArea . append ( "Undo finished\n" );
            contentTextArea . setText ( myStack . toString ());
            contentTextArea . setCaretPosition ( 0 );
            inputTextField . setText ( null );
            inputTextField . requestFocus ();
          
        }
         setBtnStatus ();
           
      
     } //GEN-LAST:event_undoMenuActionPerformed

     private   void  redoMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_redoMenuActionPerformed
       
            undoManager . redo ();
            logTextArea . append ( "Redo finished\n" );
            contentTextArea . setText ( myStack . toString ());
            contentTextArea . setCaretPosition ( 0 );
            inputTextField . setText ( null );
            inputTextField . requestFocus ();
            setBtnStatus ();
       
     } //GEN-LAST:event_redoMenuActionPerformed

     private   void  boldMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_boldMenuActionPerformed
         this . fontStyle  =   Font . PLAIN ;
         if   ( boldMenu . isSelected ())   {
             this . fontStyle  =   Font . BOLD  |   this . fontStyle ;
         }
         if   ( italicMenu . isSelected ())   {
             this . fontStyle  =   Font . ITALIC  |   this . fontStyle ;
         }
        bindFont ();
     } //GEN-LAST:event_boldMenuActionPerformed

     private   void  italicMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_italicMenuActionPerformed
         this . fontStyle  =   Font . PLAIN ;
         if   ( boldMenu . isSelected ())   {
             this . fontStyle  =   Font . BOLD  |   this . fontStyle ;
         }
         if   ( italicMenu . isSelected ())   {
             this . fontStyle  =   Font . ITALIC  |   this . fontStyle ;
         }
        bindFont ();
     } //GEN-LAST:event_italicMenuActionPerformed

     private   void  increaseMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_increaseMenuActionPerformed
         this . fontSize ++ ;
        bindFont ();
     } //GEN-LAST:event_increaseMenuActionPerformed

     private   void  decreaseMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_decreaseMenuActionPerformed
         this . fontSize -- ;
        bindFont ();
     } //GEN-LAST:event_decreaseMenuActionPerformed

     private   void  englishMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_englishMenuActionPerformed
         if   ( englishMenu . isSelected ())   {
            language  =   "language.properties" ;
            swedishMenu . setSelected ( false );
            spanishMenu . setSelected ( false );
            arabicMenu . setSelected ( false );
         }   else   if   ( ! englishMenu . isSelected ()   &&   ! swedishMenu . isSelected ()   &&   ! spanishMenu . isSelected ()   &&   ! arabicMenu . isSelected ())   {
            language  =   "language.properties" ;
            englishMenu . setSelected ( true );
         }
        bindLanguage ();
     } //GEN-LAST:event_englishMenuActionPerformed

     private   void  swedishMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_swedishMenuActionPerformed
         if   ( swedishMenu . isSelected ())   {
            language  =   "language_sw.properties" ;
            englishMenu . setSelected ( false );
            spanishMenu . setSelected ( false );
            arabicMenu . setSelected ( false );
         }   else   {
             if   ( ! englishMenu . isSelected ()   &&   ! swedishMenu . isSelected ()   &&   ! spanishMenu . isSelected ()   &&   ! arabicMenu . isSelected ())   {
                language  =   "language.properties" ;
                englishMenu . setSelected ( true );
             }
         }

        bindLanguage ();
     } //GEN-LAST:event_swedishMenuActionPerformed

     private   void  arabicMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_arabicMenuActionPerformed
         if   ( arabicMenu . isSelected ())   {
            language  =   "language_ar.properties" ;
            englishMenu . setSelected ( false );
            spanishMenu . setSelected ( false );
            swedishMenu . setSelected ( false );
         }   else   {
             if   ( ! englishMenu . isSelected ()   &&   ! swedishMenu . isSelected ()   &&   ! spanishMenu . isSelected ()   &&   ! arabicMenu . isSelected ())   {
                language  =   "language.properties" ;
                englishMenu . setSelected ( true );
             }
         }
        bindLanguage ();
     } //GEN-LAST:event_arabicMenuActionPerformed

     private   void  tutorialMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_tutorialMenuActionPerformed
         // TODO add your handling code here:
         JOptionPane . showMessageDialog ( this ,   "this program simulates the stack priciple\n\n"
                 +   "Usage: Click on buttons below\n"
                 +   "Push --> To push an element to the stack"
                 +   "\nPop --> To pop the last elment from the stack"
                 +   "\nPeek --> To show the top element in the stack"
                 +   "\nSize --> To return the size of the stack"
                 +   "\nIs empty? --> TO check weather the stack is empty or not" );
               
     } //GEN-LAST:event_tutorialMenuActionPerformed
 
     private   void  aboutMenuActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_aboutMenuActionPerformed
        String  message  =   "Sudad H. Abed\n Email: [email protected]" ;
        String  title = "About me" ;
        ImageIcon  picture = new   ImageIcon ( getClass (). getResource ( "/StackDemo/Sudad_pic.jpg" ));
        JOptionPane . showMessageDialog ( null ,  message ,  title ,  INFORMATION_MESSAGE ,  picture );
// TODO add your handling code here:
     } //GEN-LAST:event_aboutMenuActionPerformed

     private   void  peekButtonActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_peekButtonActionPerformed
   if   ( ! myStack . isEmpty ())   {
             String  peek  =  myStack . peek ();
            inputTextField . requestFocus ();
            logTextArea . append ( "<< "   + peek +   " >> is the top of the stack\n" );
          }  
       setBtnStatus ();
     } //GEN-LAST:event_peekButtonActionPerformed

     private   void  sizeButtonActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_sizeButtonActionPerformed
         // TODO add your handling code here:
     
         int  size =  myStack . size ();
        inputTextField . requestFocus ();
        logTextArea . append ( "<< The size of the stack is:"   + size +   " >> \n" );
     } //GEN-LAST:event_sizeButtonActionPerformed

     private   void  emptyButtonActionPerformed ( java . awt . event . ActionEvent  evt )   { //GEN-FIRST:event_emptyButtonActionPerformed
         // TODO add your handling code here:
         if ( myStack . isEmpty ())
            logTextArea . append ( "<< Yes, the stack is empty!!>> \n" );
         else
            logTextArea . append ( "<< No, the stack is not empty!!>> \n" );
     } //GEN-LAST:event_emptyButtonActionPerformed

     private   void   KeyTyped ( java . awt . event . KeyEvent  evt )   { //GEN-FIRST:event_KeyTyped
       if ( inputTextField . getText (). trim () == "" )  pushButton . setEnabled ( false );
       else  pushButton . setEnabled ( true );                // TODO add your handling code here:
     } //GEN-LAST:event_KeyTyped

     private   UndoManager  undoManager  =   new   UndoManager ();
     private   ArrayStack < String >  myStack  =   new   ArrayStack < String > ();
    
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private  javax . swing . JMenuItem  aboutMenu ;
     private  javax . swing . JLabel  addLabel ;
     private  javax . swing . JCheckBoxMenuItem  arabicMenu ;
     private  javax . swing . JCheckBoxMenuItem  boldMenu ;
     private  javax . swing . JMenu  changeLangMenu ;
     private  javax . swing . JTextArea  contentTextArea ;
     private  javax . swing . JMenuItem  decreaseMenu ;
     private  javax . swing . JMenu  editMenu ;
     private  javax . swing . JButton  emptyButton ;
     private  javax . swing . JRadioButtonMenuItem  englishMenu ;
     private  javax . swing . JMenu  fileMenu ;
     private  javax . swing . JMenu  fontMenu ;
     private  javax . swing . JMenu  fontSizeMenu ;
     private  javax . swing . JMenu  fontStyleMenu ;
     private  javax . swing . JMenu  helpMenu ;
     private  javax . swing . JMenuItem  increaseMenu ;
     private  javax . swing . JTextField  inputTextField ;
     private  javax . swing . JCheckBoxMenuItem  italicMenu ;
     private  javax . swing . JScrollPane  jScrollPane1 ;
     private  javax . swing . JScrollPane  jScrollPane2 ;
     private  javax . swing . JTextArea  logTextArea ;
     private  javax . swing . JMenuBar  menuBar ;
     private  javax . swing . JButton  peekButton ;
     private  javax . swing . JButton  popButton ;
     private  javax . swing . JButton  pushButton ;
     private  javax . swing . JMenuItem  redoMenu ;
     private  javax . swing . JButton  sizeButton ;
     private  javax . swing . JCheckBoxMenuItem  spanishMenu ;
     private  javax . swing . JCheckBoxMenuItem  swedishMenu ;
     private  javax . swing . JMenuItem  tutorialMenu ;
     private  javax . swing . JMenuItem  undoMenu ;
     // End of variables declaration//GEN-END:variables

     private   String  fontID ;
     private   int  fontStyle ;
     private   int  fontSize ;
     private   String  language  =   "language.properties" ;

     private   void  bindFont ()   {
         Font  font  =   new   Font ( fontID ,  fontStyle ,  fontSize );
        addLabel . setFont ( font );
        pushButton . setFont ( font );
        popButton . setFont ( font );
        peekButton . setFont ( font );
        sizeButton . setFont ( font );
        emptyButton . setFont ( font );
        fileMenu . setFont ( font );
        changeLangMenu . setFont ( font );
        englishMenu . setFont ( font );
        spanishMenu . setFont ( font );
        swedishMenu . setFont ( font );
        arabicMenu . setFont ( font );
        editMenu . setFont ( font );
        undoMenu . setFont ( font );
        redoMenu . setFont ( font );
        fontMenu . setFont ( font );
        fontStyleMenu . setFont ( font );
        boldMenu . setFont ( font );
        italicMenu . setFont ( font );
        fontSizeMenu . setFont ( font );
        increaseMenu . setFont ( font );
        decreaseMenu . setFont ( font );
        helpMenu . setFont ( font );
        tutorialMenu . setFont ( font );
        aboutMenu . setFont ( font );

     }

     private   void  bindLanguage ()   {
         String  base  =   "StackDemo/language" ;
         Locale  locale  =   Locale . ENGLISH ;
         if   ( language . equalsIgnoreCase ( "language.properties" ))   {
            locale  =   Locale . ENGLISH ;
         }
         if   ( language . equalsIgnoreCase ( "language_sw.properties" ))   {
            locale  =   new   Locale ( "sw" );
         }
         if   ( language . equalsIgnoreCase ( "language_es.properties" ))   {
            locale  =   new   Locale ( "es" );
         }
         if   ( language . equalsIgnoreCase ( "language_ar.properties" ))   {
            locale  =   new   Locale ( "ar" );
         }
        addLabel . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "addtoStack" ));
        pushButton . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "push" ));
        popButton . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "pop" ));
        peekButton . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "peek" ));
        sizeButton . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "size" ));
        emptyButton . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "isempty" ));
        fileMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "file" ));
        changeLangMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "changelanguage" ));
        englishMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "English" ));
        spanishMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Spanish" ));
        swedishMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "swedish" ));
        arabicMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Arabic" ));
        editMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "edit" ));
        undoMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "undo" ));
        redoMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "redo" ));
        fontMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Font" ));
        fontStyleMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "fontStyle" ));
        boldMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Bold" ));
        italicMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Italic" ));
        fontSizeMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "fontsize" ));
        increaseMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Increase" ));
        decreaseMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Decrease" ));
        helpMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "help" ));
        tutorialMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "Tutorial" ));
        aboutMenu . setText ( java . util . ResourceBundle . getBundle ( base ,  locale ). getString ( "About" ));
     }
}

Khalaf/bin/StackModel/exception/EmptyCollectionException.class

                package StackModel.exception;

                public 
                synchronized 
                class EmptyCollectionException 
                extends RuntimeException {
    
                public void EmptyCollectionException(String);
}

            

Khalaf/src/StackModel/exception/EmptyCollectionException.java

Khalaf/src/StackModel/exception/EmptyCollectionException.java

package   StackModel . exception ;
/**
 *  @author  Lewis and Chase
 *
 *  Represents the situation in which a collection is empty.
 */


public   class   EmptyCollectionException   extends   RuntimeException
{
   /**
   * Sets up this exception with an appropriate message.
   *  @param  collection String representing the name of the collection
   */
   public   EmptyCollectionException   ( String  collection )
   {
     super   ( "The "   +  collection  +   " is empty." );
   }
}