How do you pause a program until a button is pressed in JAVA?

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

Was this solution helpful to you?

Just Added Q & A:

Find solution

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.