This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am creating an app for fun that takes the name of a JCheckBox to add into a list that I want to do stuff with. Currently because
I am creating the list in the action listener I think it is re-initializing it. I tried setting up a variable in the main class but the action listener cannot pick up on it. I'm guessing that I need to pass it to the action listener but I am not sure how to do that. Here is my action listener code, its an item state changed since I'm looking at JCheckBox's.
To clarify I am trying to make the array out_kitchen_bros available to the itemstatechanged
and here is where I declare the variables that I think to try and make them available.
Appreciate the help. I am newish to java mainly just haven't done much of it recently and having trouble remembering some of the basics.
Joined: Mar 03, 2012
So to anyone who answers this. I found out that using ArrayList is much better. They are dynamic so are much better since I do not know the size of the array and have methods to add and remove items easily so don't have to build your own methods to do so.