Question
if you cant do it please dont waste my question include your output if you can JAVA Run this program, understand it, design a GUI
if you cant do it please dont waste my question
include your output if you can
JAVA
Run this program, understand it, design a GUI for this program. Your GUI should allow user interaction with the applications. The GUI must allow for user input and output file creation. Said GUI must be able to perform the tasks of file creation, data input and saving, and data retrieval and output. You should also include instructions to the user on what and how to use your program. Remember user-friendly. You should not have to rewrite any of the example programs just modify them to use a GUI.
Add comments to code please
import java.io.PrintWriter; import java.io.FileNotFoundException; import java.util.Scanner; public class TextFileOutputDemo { public static void main(String[] args) { String fileName = "out.txt"; //The name could be read from //the keyboard. PrintWriter outputStream = null; try { outputStream = new PrintWriter(fileName); } catch(FileNotFoundException e) { System.out.println("Error opening the file " + fileName); System.exit(0); } System.out.println("Enter three lines of text:"); Scanner keyboard = new Scanner(System.in); for (int count = 1; count <= 3; count++) { String line = keyboard.nextLine( ); outputStream.println(count + " " + line); } outputStream.close( ); System.out.println("Those lines were written to " + fileName); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started