Java Arraylist Question?
-
Declare an ArrayList to hold your CD collection. Start the program with all buttons disabled except the Initialize button. When Initialize is pressed the ArrayList will be filled with 5 CD titles. The Initialize button then becomes disabled and the other buttons become enabled. this is what i worked out ArrayList <String> cdnames = new ArrayList(); cdnames.add("Metric-Fantasies"); cdnames.add("Beatles-Abbey Road"); cdnames.add("Pearl Jam-Ten"); cdnames.add("Doors-Alive"); cdnames.add("The Rolling Stones-Gimme Shelter"); jButton1.setEnabled(true); jButton2.setEnabled(false); jButton3.setEnabled(false); jButton4.setEnabled(false); for (int j = 0; j < cdnames.size(); j++) { jTextArea1.setText( cdnames.get(j)); jTextArea1.setText( cdnames.get(j));} jButton1.setEnabled(false); jButton2.setEnabled(true); jButton3.setEnabled(true); jButton4.setEnabled(true);
-
Answer:
What is your question ?
Murtaza at Yahoo! Answers Visit the source
Related Q & A:
- How to Implement Gateway Service something similar to Oracle API gateway Using Java and Java based Open Source frameworks only?Best solution by Quora
- How do you create a Two-Dimensional ArrayList?Best solution by Stack Overflow
- How to perform operation on Arraylist?Best solution by Stack Overflow
- How to save new objects into an arrayList?Best solution by stackoverflow.com
- How to pass an ArrayList from one class to another?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.