Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have no idea what I'm doing wrong, I'm trying to get a file i choose to read a textArea but every time i run

image text in transcribed

I have no idea what I'm doing wrong, I'm trying to get a file i choose to read a textArea but every time i run the program nothing comes up in the textArea. this is the part of the code i need help with. i only can use scanner object not buffered or filereader.

else if (e.getActionCommand ().equals ("open")) //textArea. 3etText ( "") ; exampleChooser-new JFileChooser); int result = exampleChooser.showOpenDialog (null); File selectedFile-null; try ( if (resultJFileChooser. APPROVE OPTION selectedFile exampleChooser.getSelectedFile );) Scanner fileReader new Scanner (selectedFile): while (fileReader.hasNextLine ()--true) ( 3 //String newerFile-f1leReader.nexcline // String tempLine="w. ) ) ) ) cextArea. setText (fileReader.nextLine ) 56 57 158 159 160 catch (FileNotFoundException ex) ( null, Logger.getLogger (TextEditorFrame . class.getName()).log (Level.SEVERE, 161 162

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

Influences on Nonverbal Communication?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago