I am using netbeans and I put the file in the src folder for the project with the java files.
Type: Posts; User: Xrrak
I am using netbeans and I put the file in the src folder for the project with the java files.
Scanner scan = new Scanner(new File("loanData.txt")); //provide file name from outside
int counter = 0; //keep track of how many in the file
while(scan.hasNextLine())
{
...
That worked as well. Thinking on it though I guess it is simplest to have it look on the main drive, unless there is a way to tell the program that the text file is in the same place the program is...
I replaced the "/" with "C://Users/Xrrak" and that did the trick. Thanks again.
If needed, I have also included the code for all for classes and the text file in case anyone needs to run it.
package week5;
/**
*
* @author Chad McCoy
*/
Thanks for pointing me in the right direction everyone, I now have the program reading from a sequential file into an array. The only issue I am having is making the path anywhere except "/". I have...
Thanks, know of any easy to understand tutorials for these ideas? I have looked at the Oracle tutorial site over and over and it just is not making sense to me.
I am having trouble figuring out what I want to do, and the idea seems like it would be simple. I have four lines in a text file, they are strings and include "7 years at 5.35%", "10 years at 5%",...
Thanks Norm, thank goodness NetBeans IDE has a feature where you can highlight one { or } and the corresponding one highlights as well. I was missing a couple. Didn't realize the IDE did that until I...
And I am referring to using the format when I added the section:
mortgageTerms.addActionListener(
new ActionListener() {
public void...
Again sorry line 100 is: public static void main(String[] args) { //creates a new instance of the MortgageCalc class and line 105 is the last }. I have tried adding the } between the last two }.
...
Sorry the error is flagged at lines 100 and 105. I followed the same format as the other listeners, like lines 75 through 85. I have tried adding a } but that just made more errors.
This is the full text of the error shown in NetBeans IDE:
illegal start of expression
Illegal static declaration in inner class <anonymous week3.MortgageCalc$1>
modifier 'static' is only...
I thought I had made some progress with my combobox but now I am getting an illegal start of an expression error at the main method and I am not sure why.
import java.awt.*;
import...
Thank you for both the indention tip as well as the links!
Sorry I tried editing to show the correct indentations, but it did not work.
I hope this is posted in the correct forum, I have a question about changing my GUI. This is for school so I do not want anyone to write the code for me, but pointing me to a beginners tutorial on...
Hi I am currenlty taking my first Java class and I am having a little trouble. My current assignment involves modifying my payroll program application so it continues to request employee information...