Link to home
Start Free TrialLog in
Avatar of Drop_of_Rain
Drop_of_Rain

asked on

one arraylist instead of many

How could this be done.

I have 10 different sets of buttons with their actionCommands set to audiofiles. I have it set up now that each set of buttons have their own ArrayList that stores the order that the buttons are pressed.  How could one arraylist be able to store the order of all of the buttons from all of the sets. I could set it up to happen by the pressing of a special button.
Avatar of mmuruganandam
mmuruganandam
Flag of United States of America image

You can keep arraylist of arraylist

or

you can even think of use HashMap, the key would be your group name and value would be the arraylist.


Regards,
Muruga
Avatar of Mick Barry
simply add the button to the single list whenever it is pressed, what exactly is the problem?
SOLUTION
Avatar of mmuruganandam
mmuruganandam
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Drop_of_Rain
Drop_of_Rain

ASKER

There is no problem. I want to be able to create a custom section in the program. In order to do this I will have to be able to keep track of each button press in an arraylist.

In answer to the hashmap this was the way I started to do it. If I need to do that I am OK with that.

There is no Group name, I didn't know that could be done. Well maybe there is a group name they all start with the same first letters kp1-kp50  and dm1-dm50 etc.
do u need to store what group each button is in?
If you are clear about having different sections and keep track of those buttons in a arraylist, you can have groupname and start adding to the map.
No if I understand your question. That is taken care of by the audiofile name, but in this case it won't matter.
Then go ahead with a single array list as you had before.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you are clear about having different sections and keep track of those buttons in a arraylist, you can have groupname and start adding to the map.

The group name would be the name of the Arraylist for each section.


simply add the button to the single list whenever it is pressed, what exactly is the problem?

I guess a single arrarlist could be set up to record all the buttons pressed each time and not use it except when the custom part is wanted.
What is the problem now
Thanks again you guys,
Christopher