
如果你正在寻找速度快延迟低的国外vps,不妨试试Jtti.cc的vps云主机,面向中国大陆的用户群体提供专业高端的网络线路,三网电信双向CN2/联通AS9929/移动CMI,网络稳定,支持windows和Linux操作系统,免费切换/安装,提供1M-1000M带宽,可选择新加坡CN2 GIA、香港CN2 GIA、美国CN2 GIA;

****************************************package ;import ;import ;import ;import ;import ;import ;import ;import ;import ;import ;import ;import ;public class Note implements ActionListener { JFrame jf = new JFrame(记事本); JTextArea jtf = new JTextArea(); String x; String k=; int m = 0; int n = 0; int q = 0; public void actionPerformed(ActionEvent e) {String comm = ();if (新建(comm)) { m = m + 100; n = n + 50; new Note(m, n);} else if (打开(comm)) { JFileChooser jfc = new JFileChooser(); int w = (null); if (w == _OPTION) {x = ()();String result = ;try { FileInputStream fis = new FileInputStream(x); byte[] b = new byte[1024]; while (true) {int num = (b);// num返回实际的读到的字节数,如果读完了返回-1;if (num == -1) break;result = result + new String(b, 0, num); } (result); (()()); ();} catch (Exception e1) { ();} }} else if (保存(comm)) { String s = (); if (x == null) {JFileChooser jfc = new JFileChooser();int w = (null);if (w == _OPTION) ;{ String m = ()(); String k = (); try {FileOutputStream fos = new FileOutputStream(m);(());(); } catch (Exception e1) {(); }} } else {try { FileOutputStream fos = new FileOutputStream(x); (()); ();} catch (Exception e1) { ();} }} else if (另存(comm)) { JFileChooser jfc = new JFileChooser(); int w = (null); if (w == _OPTION);{String m = ()();String s = ();try { FileOutputStream fos = new FileOutputStream(m); (()); ();} catch (Exception e1) { ();} }} else if (退出(comm)) { (0);} else if (撤销(comm)) {} else if (剪切(comm)) { ();} else if (复制(comm)) { ();} else if (粘贴(comm)) { ();} else if (删除(comm)) { ();} else if (全选(comm)) { ();} else if (查找(comm)) { Change cg=new Change(); =jtf;// JOptionPane jop = new JOptionPane();// String s = (请输入要查找的内容:);// if (s == null)//return;// // String ss = ();// if (!(s)) q = 0;// k = s;// if ((s) != -1) {//((s, q), (s, q) + ());//q = (s, q) + 1;// } else {//(null, 没有找到, 输入错误,//_MESSAGE);// }} else if (替换(comm)) { Change cg=new Change(); =jtf;// JOptionPane jop = new JOptionPane();// String s = (请输入要替换的内容:);// if (s == null)//return;// String ss = ();// String sw = (请输入替换后的内容);//// while (true) {//if ((s) != -1) {// (sw, (s), (s)// + ());// ss = ();//} else// return;// } // else{ // (null, 没有找到, 输入错误, // _MESSAGE); // }} else if (版本(comm)) { JOptionPane w = new JOptionPane(); (jf, 007版, 版本, _MESSAGE); // (true);} } public Note() {This(0, 0); } public Note(int m, int n) {JMenuBar jmb = new JMenuBar();String[] s1 = { 文件, 编辑, 帮助 };String[][] s2 = { { 新建, 打开, 保存, 另存, 退出 },{ 撤销, 剪切, 复制, 粘贴, 删除, 全选, 查找, 替换 }, { 版本 } };for (int i = 0; i < ; i++) { JMenu jm = new JMenu(s1[i]); (jm); for (int j = 0; j < s2[i]; j++) {if ((s2[i][j])) { ();}JMenuItem jmi = new JMenuItem(s2[i][j]);(jmi);(this); }}// (true);(jmb);JScrollPane jp = new JScrollPane(jtf);// (true);(jp);(m, n);(500, 500);// (false);(true);// 设置可见// (_ON_CLOSE); } public static void main(String[] args) {Note nt = new Note(); }}*******************************************package ;import ;import ;import ;import ;import ;import ;import ;import ;import ;public class Change implements ActionListener{ JTextArea jtf=new JTextArea(); JTextField jtf1=new JTextField(); JTextField jtf2=new JTextField(); String s=; int q=0; String k=; String ss=; public void actionPerformed(ActionEvent e) {String comm=();if(查找(comm)){ chazhao(jtf);}else{ tihuan(jtf);} } public Change(){JFrame jf=new JFrame(替换文本);GridLayout gl=new GridLayout(2,2);JPanel jp=new JPanel();JButton jb1=new JButton(查找);JButton jb2=new JButton(替换);//JLabel jl2=new JLabel();(gl);(jtf1);(jb1);(jtf2);(jb2);(this);(this);(true);(300,300);(200,70);//(_ON_CLOSE); } public static void main(String[] args){new Change(); } public void chazhao(JTextArea jtf){s=();//(s);if ((s)) return;ss = ();//(ss);if (!(s)){ q = 0; ();}k = s;if ((s,q) != -1) { ((s, q), (s, q) + ()); q = (s, q) + 1;} else { (null, 已找到结尾, 输入错误, _MESSAGE);} } public void tihuan(JTextArea jtf){String s=();(s, (),());q=q+()-1; }}**********************************************完了 直接运行就可以了记得把包名改下完全可以运行。给分吧
发表评论