I tried to compare datas from one list to another list.And if the condition is satisfied it should have to add to another list..This works fine in normal class but its not working in my Applet class(I know that i should not use S.O.P statement in paint()..I used just to check datas were there or not?)

Java Code:
protected void paintComponent(Graphics g)
{
drawwrk(g);
}

public void drawwrk(Graphics g){
             Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
          
        
            XMLReading xmlreadingObj = new XMLReading();
            try {
                xmlreadingObj.fileParsing("C:/Documents and Settings/Gantt.xml");
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            } catch (SAXException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        
        res_mseg = xmlreadingObj.res_list;
        Object [] array = res_mseg.toArray();
        
        rev_list = xmlreadingObj.rev__wrkOrder_list;
        Object [] array1 = rev_list.toArray();
        
        wrk = new ArrayList<WrkorderData>();
        wrk = xmlreadingObj.wrkorder_list;
          
        frm_list = xmlreadingObj.rev_frmdate_list;
        ArrayList<Date> l = new ArrayList<Date>();
        List str_list = new ArrayList();
                                      
        String str1 = new String();
        String str2 = new String();
        ArrayList<String> list = new ArrayList();
        ArrayList list1 = new ArrayList();
        ArrayList list2 = new ArrayList();
        
        frmdate_list = xmlreadingObj.rev_frmdate_list;
       
        for(int len = 0; len < array.length; len++)
        {
           str1 = array[len].toString();
           for(int len1 = 0; len1 < array1.length; len1++)
           {
               str2 = array1[len1].toString();
               if(str1.compareToIgnoreCase(str2) == 0 )
               {     
                   list.add(frm_list.get(len1).toString());
                   list1.add(wrk.get(len1));
                   list2.add(frmdate_list.get(len1).toString());
               }
            
            }
        }
        System.out.println("Size"+list.size());
        
        System.out.println("Size"+list2.size());
        Iterator  it  = list2.iterator();
        while(it.hasNext()){
            g2.drawString(""+it.next(),100,100);
            System.out.println(it.next());
        }
        
            
        }