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 03-11-2008, 11:18 PM
Member
 
Join Date: Jan 2008
Posts: 16
newtojava7 is on a distinguished road
arraylists problem
hi

im working on a song manager for an assignment. ive gotten the program to store every mp3's artist and song name into two respective arraylists. then i display the contents of these array lists in two J-Lists, one named artists and another named songs.

so say I have a folder containing just madonna songs and say she has 5 songs:

madonna - a
madonna - b
madonna - c
madonna - d
madonna - e

where the letters represent songs. whats happening right now is it stores each madonna song just fine since they are different names, however for the artist JList the madonna is repeating 5 times since its being stored in the array list 5 times, since my program is finding her name 5 times. how can I get it to store madonnas name only once, so that under my artist JList her name appears only once. obviously under the artists i want each artists name appearing only once, regardless of how many songs they have.

thanks in advance
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-12-2008, 08:38 AM
Member
 
Join Date: Mar 2008
Posts: 7
saint_jorjo is on a distinguished road
you have to made arraylist to arraylist
ArrayList madonna = new Arr...
ArrayList singer = new Arr...
madonna.add(a);....
...
singer.add(madonna);
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
A Map implemented with ArrayLists Java Tip java.lang 0 04-16-2008 11:29 PM
recursively searching through arraylists newtojava7 New To Java 1 03-17-2008 03:36 AM


All times are GMT +3. The time now is 04:30 PM.


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