Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

mixing up an arraylist really good.

Posted on 2004-03-31
9
Medium Priority
?
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 86

Assisted Solution

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

Accepted Solution

by:
bobbit31 earned 300 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

604 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