[email protected]
也给我发一份吧,谢谢!

解决方案 »

  1.   

    邮箱:[email protected]谢谢!
      

  2.   

    jbuilder 的example里面有,小改一下就可以了
      

  3.   

    给我一份,谢谢!!
    [email protected]
      

  4.   

    SourceForge上有个很NB的叫JEDIT,是76个人一起做的,功能很强
    可以去DOWN一个学习
      

  5.   

    我写了一个,但是只能在工程所在文件夹读取和保存。
    你可以参考一下package myprojects.w10;import java.io.*;
    import java.awt.*;
    import java.awt.event.*;class W10 extends Frame implements ActionListener
    {
    TextArea ta=new TextArea();
    MenuBar mb=new MenuBar();
    Menu m1=new Menu("File");
    MenuItem open=new MenuItem("Open");
    MenuItem close=new MenuItem("Close");
    MenuItem save=new MenuItem("Save");
    MenuItem exit=new MenuItem("exit");

    FileDialog fileDlg;
    String str,fileName;
    byte byteBuf[]=new byte[1000000];

    public W10() 
    {
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    dispose();
    System.exit(0);
    }
    });

    add("Center",ta);

    m1.add(open);
    m1.add(close);
    m1.add(save);
    m1.addSeparator();
    m1.add(exit);
    open.addActionListener(this);
    close.addActionListener(this);
    save.addActionListener(this);
    exit.addActionListener(this);

    mb.add(m1);
    setMenuBar(mb);
    show();
    }

    public void actionPerformed(ActionEvent e)
    {
    if(e.getSource()==exit)
       System.exit(0);
    else if(e.getSource()==close)
       ta.setText(null);
    else if(e.getSource()==open)
    {
       fileDlg=new FileDialog(this,"Open File");
       fileDlg.show();
       fileName=fileDlg.getFile();
       try
       {
        FileInputStream in=new FileInputStream(fileName);
        in.read(byteBuf);
        in.close();
        str=new String(byteBuf);
        ta.setText(str);
        setTitle("Notepad-"+fileName);
       }
          catch(IOException ioe){}
    }      
    else if(e.getSource()==save)   
    {
    fileDlg=new FileDialog(this,"Save File",FileDialog.SAVE);
    fileDlg.show();
    fileName=fileDlg.getFile();
    str=ta.getText();
    byteBuf=str.getBytes();
    try
    {
    FileOutputStream out=new FileOutputStream(fileName);
    out.write(byteBuf);
    out.close();
    }
       catch(IOException ioe){}
    }
    } public static void main(String args[]) {

    W10 mainFrame = new W10();
    mainFrame.setSize(500, 400);
    mainFrame.setTitle("Notepad");
    mainFrame.setVisible(true);
    }
    }
      

  6.   

    [email protected]
    [email protected]
    [email protected]
    [email protected]我写的记事本:jNotepad 1.4 [支持关键字高亮]...各位看看...给个评价.
      

  7.   

    能给我一份看看吗?
     [email protected]