I am writing a program with arrays, the user is able to enter up to ten entries. The numbers get placed in the array, next the user is able to either search for a number in the array, or they can simply type in the index number and if its valid it would be displayed in a text field. I am able to do all of that, but all the numbers at index six and above are zero.

Code:
// ArrayAccess.java

import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.awt.event.*;


public class ArrayAccess extends JFrame {
   private JTextField inputField, retrieveValueField, retrieveIndexField, outputField;
   private JPanel inputArea, inputPanel, retrievePanel, outputPanel;
   private StringTokenizer splitter;
   private int num, accessArray[];
   private String input;
   
   
   // set up GUI
   public ArrayAccess()
   {
      super( "Accessing Array values" );
      
      accessArray = new int[ 10 ];
      
      // get content pane and set its layout
      Container container = getContentPane();
      container.setLayout( new FlowLayout() );
      
      // set up input Panel
      inputPanel = new JPanel();
      inputPanel.add( new JLabel( "Enter array elements here" ) );
      inputField = new JTextField( 10 );
      inputField.addActionListener( 
      
         new ActionListener() {

            public void actionPerformed( ActionEvent e ) 
            {
            	try
            	{
            		input = inputField.getText();
            		splitter = new StringTokenizer(input,",");
            		
            		for(int x = 0; x <= splitter.countTokens(); x++)	
            		{
            			accessArray[x] = Integer.parseInt(splitter.nextToken());
            		}
            	}
            	catch(Exception exc){System.out.println("Error");}
            	inputField.setText( "" );
            } // end method actionPerformed 

         } // end anonymous inner class
         
      ); // end call to addActionListener

      inputPanel.add( inputField );
      container.add( inputPanel );
      
      // set up retrieve Panel
      retrievePanel = new JPanel( new GridLayout( 2, 2 ) );
      retrievePanel.add( new JLabel( "Enter number to retrieve" ) );
      retrieveValueField = new JTextField( 10 );
      retrieveValueField.addActionListener( 

         new ActionListener() {
         
            public void actionPerformed( ActionEvent event )
            {
               try
               {
               		num = Integer.parseInt(retrieveValueField.getText());
               		for(int x = 0; x<accessArray.length;x++)
               		{
               			if(accessArray[x] == num)
               			{
               				outputField.setText("Number "+ num + " found at index: "+ x);
               			}	
               		}
               			
               }
               catch(NumberFormatException nfe){System.err.println("Bad Number Format");}
               catch(NumberNotFoundException nnfe){System.err.println("Number Not Found");}
               
               retrieveValueField.setText( "" );
               
            } // end method actionPerformed
         
         } // end anonymous inner class
         
      ); // end call to addActionListener
      
      retrievePanel.add( retrieveValueField );      
      retrievePanel.add( new JLabel( "Enter index to retrieve" ) );
      retrieveIndexField = new JTextField( 10 );
      retrieveIndexField.addActionListener(

         new ActionListener() {
         
            public void actionPerformed( ActionEvent event )
            {
            	
            	try
            	{
            		num = Integer.parseInt(retrieveIndexField.getText());
            		outputField.setText("Number at index: " + num + " is "+ accessArray[num]);
            	}
            	catch(ArrayIndexOutOfBoundsException bounds){System.err.println("Bad index specified");}
            	catch(NumberFormatException number){System.err.println("Bad input");}
            	
               retrieveIndexField.setText( "" );
               
            } // end method actionPerformed
         
         } // end anonymous inner class
         
      ); // end call to addActionListener
      
      retrievePanel.add( retrieveIndexField );
      container.add( retrievePanel );
      
      // set up output Panel
      outputPanel = new JPanel();
      outputPanel.add( new JLabel( "Result" ) );
      outputField = new JTextField( 30 );
      outputField.setEditable( false );
      outputPanel.add( outputField );
      container.add( outputPanel );
      
      setSize( 400, 200 );
      setVisible( true );
      
   } // end constructor
    
   // execute application
   public static void main( String args[] )
   {
      ArrayAccess application = new ArrayAccess();
      application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
   }
   
} // end class ArrayAccess
Thanks for any suggestions