Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2008, 12:07 PM
Member
 
Join Date: Jan 2008
Posts: 78
Preethi is on a distinguished road
No datas in added to arraylist
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?)

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()); } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Project Trouble: Searching one ArrayList with another ArrayList BC2210 New To Java 2 04-21-2008 12:43 PM
Tree with Listener not working when added to ScrollPane praveen.kb AWT / Swing 2 01-09-2008 08:06 AM
how to refresh the table when a new account is added and display instantly sravanthi narra SWT / JFace 4 01-05-2008 08:39 PM
New to arraylist kleave New To Java 2 11-19-2007 07:45 PM
Help ArrayList.add() eNine New To Java 2 08-06-2007 02:13 PM


All times are GMT +3. The time now is 08:21 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org