日期:2014-05-20  浏览次数:20622 次

老大,谁有用JAVA编写的记事本呀?
老大,谁有用JAVA编写的记事本呀?

------解决方案--------------------
我有
内容太长发不上去
------解决方案--------------------
给我也传一份吧
谢谢
我的邮箱是huayufei@tom.com

------解决方案--------------------
貌似csdn以前有这样的帖子,查查吧
------解决方案--------------------
JDK就有自带的记事本的例子,还源代码,楼信为什么不用
------解决方案--------------------
我也想要,也我发一份吧.xinxin01261982@hotmail.com
------解决方案--------------------
也发份给我吧.ice_ro505@yahoo.com.cn
------解决方案--------------------
编JAVA的记事本
------解决方案--------------------
刚编了一个,发不了
------解决方案--------------------
我也想要一个,谢谢
yvhkpgf_cn@sina.com
------解决方案--------------------
大佬给发份 minghui.hao@hotmail.com
------解决方案--------------------
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.io.*;
import javax.swing.event.UndoableEditEvent;
import javax.swing.text.Document;
import javax.swing.undo.UndoManager;

class Windows2 extends JFrame
{
private JTextArea txt;
private JMenuBar bar;
private JScrollPane jsp;//定义滚动条
private JMenu filemenu;
private JMenu editmenu;
private JMenu geshimenu;
private JMenu helpmenu;
private JMenuItem filenew;
private JMenuItem fileopen;
private JMenuItem filesave;
private JMenuItem filesaveto;
private JMenuItem filequit;
private JMenuItem editchexiao;
private JMenuItem edithuifu;
private JMenuItem editjianqie;
private JMenuItem editcopy;
private JMenuItem editzhantie;
private JMenuItem editdelete;
private JCheckBoxMenuItem geshiautowrap;
private JMenuItem geshifont;
private JMenuItem helpabout;
private Document doc = null;
private UndoManager undomang = null;
private static final long serialVersionUID = -2397593626990759111L;

Windows2(String title)
{
super(title);
//
undomang = new UndoManager()
{
private static final long serialVersionUID = -5960092671497318496L;
public void undoableEditHappened(UndoableEditEvent e)
{
this.addEdit(e.getEdit());
}
};
txt=new JTextArea();
//定义文本域;
jsp=new JScrollPane(txt);
add(jsp);//在文本域中添加滚动条
doc = txt.getDocument();
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//****************************定义菜单栏******************************************
bar=new JMenuBar();

filemenu=new JMenu( "文件 ");//文件菜单
filemenu.setMnemonic(KeyEvent.VK_ALT);
//MenuShortcut msc1=new MenuShortcut(KeyEvent .VK_A ,false);
filenew =new JMenuItem( "新建 ");
filenew.setMnemonic(KeyEvent.VK_N);
filenew.addActionListener(new handle());
fileopen=new JMenuItem( "打开... ");
fileopen.addActionListener(new OpenL());
filesave =new JMenuItem( "保存 ");
filesave.addActionListener(new SaveL());
filesaveto =new JMenuItem( "另存为... ");
filequit=new JMenuItem( "退出 ");
filequit.setMnemonic(KeyEvent.VK_Q);