Question: 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

 I have no idea what I'm doing wrong, I'm trying to

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!