Click here to Skip to main content
15,354,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I'm making a festival scheduling app that takes user input from a Swing GUI and then schedules all the songs according to time and priority.

I'm just wondering do I store the input in multiple Variables or an array.
Also, after that how do I put this input into another class for processing?

The deadline is getting closer so if there is anything you can suggest I would be really grateful!

What I have tried:

Storing the input in a global variable.

Scoring the internet for the right answer. Not sure where to begin.
Posted
Comments
Richard MacCutchan 15-May-22 10:54am
   
You can store the details anywhere you want. But without more details of your code it is impossible to make a valid suggestion.
daniel wakeley 21-May-22 8:41am
   
Hi sorry for the late reply. Here is roughly what I want to do.
I'm just wondering how to actually store the inputs into a class instance instead of an Array


  //Instatiates driver method
    public static void main(String[] args)
    {
        PetInput ArE = new PetInput();
        ArE.driver();   //lines edited to meet JavaRanch restrictions on abbreviations
    }
     
     private class AddPetButtonHandler implements ActionListener
    {
       public void actionPerformed(ActionEvent e)
       {
         petName = String.parseString(nameTF.getText());
         petAge = Int.parseInt(ageTF.getText());
         petGender = //not sure how to store gender
          
         petInfo.add(petName);
         petInfo.add(petAge);
         petInfo.add(petGender);
         }
.
.
.
    }



Pet p = new Pet();
p.setName(nameBox.getText());
p.setSize(Integer.parseInt(sizeBox.getText()));
// etc etc

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900