i am a student and i'm working on my final project.
i'm want to execute the whole .txt file using JOptionPane but instead of displaying the whole .txt file,my programe execute it line by line by clicking 'ok' button..please help..
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
i am a student and i'm working on my final project.
i'm want to execute the whole .txt file using JOptionPane but instead of displaying the whole .txt file,my programe execute it line by line by clicking 'ok' button..please help..
Can you explain what it means to "execute a txt file"?i'm want to execute the whole .txt file
Post a few sample lines from a text file
and show what happens when each line is "executed"
Do you mean that you want the program to read the file a line at a time and display that line when a GUI button is pressed? Each button press will display the next line.
If you don't understand my answer, don't ignore it, ask a question.
In the loop: Read the contents and add an endline character "\n" at the end of each line and concatenate the line to the String that is to be displayed in the dialog box.i want the dialog box display all the content in a single dialog box only...
Display the String after the end of the loop has gotten all the lines.
Please edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.
If you don't understand my answer, don't ignore it, ask a question.