draw a bar chart in java linking with array
===

so, basically i need to get my code to draw a bar chart when it displays its answer. the code checks word length frequency to assess patterns in writing e.g. i am a man would give 2, 1, 1.
what i need is this 2, 1, 1 to be shown as a bar chart that has been drawn with like drawString or drawRectangle etc. its for an applet.
i get the bases of how i need to do, the graph pulls the info from my string array and then draws one of the bars to that length an so

heres my code hopefully you understand what i am talking about

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



    public class Clarke_J_resitAss  extends Applet implements ActionListener

	{
	    Button pr_input1, pr_input2;
	    Label pr_label;
	    TextField pr_text;
	    String pr_name;

	    public void init()

	    {
	        pr_input1 = new Button("Analyze");
	        pr_input2 = new Button("Reset");
	        add(pr_input1);
	        add(pr_input2);
	        pr_input1.addActionListener(this);
	        pr_input2.addActionListener(this);
	        //add the buttons with action listeners
	        pr_label = new Label("Word Pattern");
	        add(pr_label);
	        pr_text = new TextField();
	        add(pr_text);
	        pr_text.addActionListener(this);
	        //add text field
	    }	 
	    public void start()
	    {	        
	        pr_name="";
	            setSize(400,400);
	            setBackground(Color.gray);
	        pr_text.setBackground(Color.white);      
	    }

	    public void actionPerformed(ActionEvent e){
	    	


        pr_name = e.getActionCommand();
        repaint();
	        if(e.getSource() == pr_input1)
	        	pr_name = pr_text.getText();
	        else
	            if(e.getSource() == pr_input2)
	            {   pr_name = "";        
	                pr_text.setText("");
	                pr_label.setText("Word Pattern");
	                }
	         repaint();
	             // The user's input from the text area.         	         
	            int pr_char;
	           
	            String array[]=pr_name.split(" ");
	           int counter=0;
	           for(int i=0;i<array.length;i++){
	        	   int length = array[i].replaceAll("[^A-Za-z]", "").length();
	               if(counter<length)
	                   counter=length;}
	           int intArray[]=new int[counter];
	           for(int i=0;i<intArray.length;i++){
	               intArray[i]=0;
	           }
	           for(int i=0;i<array.length;i++){
	               intArray[array[i].replaceAll("[^A-Za-z]", "").length()-1]++;
	           }
	           String a="";
	           for(int i=0;i<intArray.length;i++){
	               if(intArray[i]>0)
	               {
	                a+=String.valueOf(intArray[i]);
	                a+=", ";
	               }
	           }
	           pr_label.setText(a);

	 
	           pr_char = pr_name.length(); 
	    }

	    public void paint(Graphics g)
	    {

	      pr_text.setSize(400, 200);
	      pr_text.setLocation(0,0);
	      pr_input1.setLocation(0,220);
	      pr_input2.setLocation(337,220);
	      pr_label.setLocation(0,270);
	      pr_label.setSize(400,30);
	    }
	}
