Results 1 to 3 of 3
- 01-09-2013, 11:53 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 8
- Rep Power
- 0
ActionListener with for loop problem
Hello, I am making an Amortization Schedule, and when I press my calculate button, it adds rows to the table and sets values to variables. When I only use the for loop it works great, but when I use the variables the program does nothing when I press the button.
ActionListener code:
Java Code:public void actionPerformed(ActionEvent event) { if(event.getSource()==calc){//calc is button //these are for the calculations yearsLoan = Integer.parseInt(yLField.getText()); interestRate = Integer.parseInt(iRField.getText()); loanAmount = Integer.parseInt(lAField.getText()); //adds rows for the number of payments for(int counter = 0;counter<=12*yearsLoan;counter++){ DefaultTableModel.addRow(data);//data is a vector } }
-
Re: ActionListener with for loop problem
Where do you create and put information into the data vector? You would need to do this inside of the for loop where you would create a new Vector, set the data that it holds with each iteration of the for loop.
-
Re: ActionListener with for loop problem
Shoot you've already asked this question elsewhere on this site. Please don't waste the forum member's time re-asking the same question in multiple locations. This is not fair to us and is not appreciated. Locking.
Similar Threads
-
Have problem with add.ActionListener()
By emily.m in forum AWT / SwingReplies: 5Last Post: 02-22-2012, 09:36 PM -
Problem with ActionListener?
By Manish87 in forum AWT / SwingReplies: 5Last Post: 03-31-2011, 02:54 PM -
no return- problem with actionlistener
By lparadiso in forum AWT / SwingReplies: 2Last Post: 11-21-2010, 02:31 AM -
Problem Actionlistener
By Questionmark in forum New To JavaReplies: 18Last Post: 08-07-2010, 12:29 PM -
ActionListener run automatically problem
By cassysumandak in forum New To JavaReplies: 1Last Post: 03-23-2009, 09:42 PM


1Likes
LinkBack URL
About LinkBacks

Bookmarks