Board index » off-topic » An Error In Tutorial: Building A Java Text Editor
Bharti Kumar
Delphi Developer |
An Error In Tutorial: Building A Java Text Editor2005-02-05 05:41:38 AM off-topic2 I'm following the above said Tutorial included in the Borland JBuilder 2005 (Enterprise Trial). It works OK until step 9, but at step 10, when I use the following code I get an error at the shown arrow position. Can anybody help??? As I'm new to this JBuilder & don't know what to do about it? I tried few tricks but then I get more errors. I'm really disappointed. I'll appreciate the help to solve it. // Save current file; handle not yet having a filename; report to statusBar. boolean saveFile() <----- (Here I get an error that says";" expected) { // Handle the case where we don't have a file name yet. if (currFileName == null) { return saveAsFile(); } try { // Open a file of the current name. File file = new File (currFileName); // Create an output writer that will write to that file. // FileWriter handles international characters encoding conversions. FileWriter out = new FileWriter(file); String text = jTextArea1.getText(); out.write(text); out.close(); this.dirty = false; // Display the name of the saved directory+file in the statusBar. statusBar.setText("Saved to " + currFileName); return true; } catch (IOException e) { statusBar.setText("Error saving "+ currFileName); } return false; } Thanks In Advance |