Problem with Saving/Open

I need to get a simple word editor program I am making to save and load documents, but don't know how to really do this.

Here is what I have so far, (well just for this class), any advice on getting the Save or Open to work will greatly be appreciated

Thanks in advance

import java.awt.*;

import java.awt.event.*;

class EditorMenuHandlerimplements ActionListener, ItemListener{

private Editor editor;

protected EditorMenuHandler(Editor editor){ this.editor = editor;}

publicvoid actionPerformed(ActionEvent ae){

FileDialog filedialog;

final SearchDialog searchDialog;

String arg = (String)ae.getActionCommand();

// the Open ... case

if(arg.equals(Editor.fileLabels[0])){

if(Editor.VERBOSE)

System.err.println(Editor.fileLabels[0] +

" has been selected");

filedialog =new FileDialog(editor,"Open File Dialog", FileDialog.LOAD);

filedialog.show();

if(Editor.VERBOSE){

System.err.println("Exited filedialog.setVisible(true);");

System.err.println("Open file = " + filedialog.getFile());

System.err.println("Open directory = " + filedialog.getDirectory());

}

}

//the Save ... case

if(arg.equals(Editor.fileLabels[1])){

if(Editor.VERBOSE)

System.err.println(Editor.fileLabels[1] +

" has been selected");

filedialog =new FileDialog(editor,"Save File Dialog", FileDialog.SAVE);

filedialog.show();

if(Editor.VERBOSE){

System.err.println("Exited filedialog.setVisible(true);");

System.err.println("Save file = " + filedialog.getFile());

System.err.println("Save directory = " + filedialog.getDirectory());

}

}

//the Search ... case

if(arg.equals(Editor.fileLabels[2])){

if(Editor.VERBOSE)

System.err.println(Editor.fileLabels[2] +

" has been selected");

searchDialog =new SearchDialog(editor);

searchDialog.show();

if(Editor.VERBOSE)

System.err.println("searchDialog.show(); has exited");

}

//the Quit ... case

if(arg.equals(Editor.fileLabels[3])){

if(Editor.VERBOSE)

System.err.println(Editor.fileLabels[3] +

" has been selected");

System.exit(0);

}

//the Cut case

if(arg.equals(Editor.editLabels[0])){

if(Editor.VERBOSE)

System.err.println(Editor.editLabels[0] +

" has been selected");

}

//the Copy case

if(arg.equals(Editor.editLabels[1])){

if(Editor.VERBOSE)

System.err.println(Editor.editLabels[1] +

" has been selected");

}

//the Paste case

if(arg.equals(Editor.editLabels[2])){

if(Editor.VERBOSE)

System.err.println(Editor.editLabels[2] +

" has been selected");

}

}

/**

* This needs to be here since we need to implement the ItemListener

* interface

* @see java.awt.event.ItemListener

*/

publicvoid itemStateChanged(ItemEvent ie){

//shouldn't need to do anything here.

}

}

[5484 byte] By [AdiVa] at [2007-11-27 5:30:35]
# 1
Well, presuming you want to use FileDialog and not JFileChooser, it's a start...But mainly you show the file dialog... you have to do something with the file selected.
bsampieria at 2007-7-12 14:54:59 > top of Java-index,Java Essentials,New To Java...
# 2
Yeah, it isn't working now, but the thing is I really am lost as to how to proceed from here.
AdiVa at 2007-7-12 14:54:59 > top of Java-index,Java Essentials,New To Java...
# 3
Proceed to do what?If you want to read the file in, use a FileInputStream or FileReader or something from java.io or nio or whatever is appropraiate.
bsampieria at 2007-7-12 14:54:59 > top of Java-index,Java Essentials,New To Java...