Solved

mixing up an arraylist really good.

Posted on 2004-03-31
9
226 Views
Last Modified: 2008-03-06
With the list that is collected from the number of checkboxs checked: (code below)

// Audio files from checkboxs
if (cb.isSelected())
{
  File audio = new File(cb.getActionCommand());
  list.add(audio);  // method to add audio to ListOfFiles
}


How could I mix those files in the arraylist up really good.

0
Comment
Question by:Drop_of_Rain
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 75 total points
ID: 10727225
Collections.shuffle(list)
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 75 total points
ID: 10727231
Collections.shuffle(<yourArrayList>);
0
 
LVL 92

Expert Comment

by:objects
ID: 10727260
you should have already known the answer to that ;) You already use that technique in your existing code.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:Drop_of_Rain
ID: 10727289
I thought that was it but I might need to shuffle them a couple of times. I looked at it shuffled once that is why i asked the question. Another dump question i have asked.
0
 
LVL 92

Expert Comment

by:objects
ID: 10727328
> Another dump question i have asked.

No such thing as dumb (or dump) questions :)
0
 

Author Comment

by:Drop_of_Rain
ID: 10727380
That was funny seeing what I wrote.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10727482
?
0
 

Author Comment

by:Drop_of_Rain
ID: 10727487
I increased the points bt 75 because you both gave the same answer.

Thanks,
Christopher
0
 

Author Comment

by:Drop_of_Rain
ID: 10727511
bobbit31 answered another question just a little while ago, it would have worked fine, so I gave him this one because of that. I hope that is OK with everyone.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question