Results 21 to 28 of 28
-
Re: Passing an array to another class in a JFrame
Well, walk through what your current code does:
- A user enters a number into the number JTextField
- The user then presses the jbtEnter JButton
- This calls the EnterListener's actionPerformed method
- This loops a bit less than 50 times (your for loop is bad in that you increment the counter variable, i, inside of the loop, something that you should almost never do).
- In the for loop, you get the String held by the number JTextField, convert it to an int, and add it into an ArrayList<Integer>, and again, you do this *many* times in a row, about 25 times.
This is what i'm asking you -- do you want to add the same number into the ArrayList 25 times? If not, get rid of that for loop.
- 05-05-2012, 10:25 PM #22
Member
- Join Date
- May 2012
- Posts
- 20
- Rep Power
- 0
Re: Passing an array to another class in a JFrame
I did erase the for loop
-
Re: Passing an array to another class in a JFrame
- 05-05-2012, 11:10 PM #24
Member
- Join Date
- May 2012
- Posts
- 20
- Rep Power
- 0
Re: Passing an array to another class in a JFrame
thanks for trying to help
-
Re: Passing an array to another class in a JFrame
- 05-05-2012, 11:14 PM #26
Member
- Join Date
- May 2012
- Posts
- 20
- Rep Power
- 0
Re: Passing an array to another class in a JFrame
Not complete yet. Still having some issues with the loop to make it stop at 50 but working on it.
- 05-06-2012, 01:10 AM #27
Member
- Join Date
- May 2012
- Posts
- 20
- Rep Power
- 0
Re: Passing an array to another class in a JFrame
Any advice on the loop portion to stop at 50?
-
Re: Passing an array to another class in a JFrame
Similar Threads
-
Passing 2 dementional array to a new class
By anonymous in forum New To JavaReplies: 4Last Post: 03-15-2011, 11:07 PM -
Passing array to model class
By keshaba in forum IntelliJ IDEAReplies: 0Last Post: 04-20-2010, 01:43 PM -
Passing data from one JFrame to another JFrame. - need help.
By Unsub in forum New To JavaReplies: 6Last Post: 04-12-2010, 11:33 AM -
Passing data from one JFrame to another JFrame
By tarami in forum New To JavaReplies: 3Last Post: 08-06-2009, 05:44 PM -
problem in accessing array values of one class in to jframe class
By cenafu in forum AWT / SwingReplies: 8Last Post: 03-21-2009, 09:34 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks