資源簡介
java編輯器源碼!!歡迎大家下載!!完整的例子!!!包含很多的功能!!!歡迎踴躍下載!!能很好的進行相關學習!!!!

代碼片段和文件信息
import?java.awt.*;
import?java.awt.event.*;
import?java.io.*;
import?java.util.*;
import?java.awt.datatransfer.*;
import?java.awt.event.*;
import?java.text.*;
import?javax.swing.*;
import?javax.swing.event.*;
import?javax.swing.text.Caret;
import?javax.swing.undo.*;
public?class?note?{
public?static?void?main(String[]?args)
{?
myfr?fr=new?myfr(“我的java編輯器“);
fr.setSize(700400);
}
}
///////////////////////////myfr主窗體類//////////////////////////////////////
class?myfr?extends?Jframe?implements?ActionListener
{?
String?strstrnextpathfname;?//部分變量的聲明
JPanel?mainpane;?
JFileChooser?choose?=?new?JFileChooser();?//文件對話框
Dialog?findreplace;?//find為查找對話框,replace對話框
JTextField?findtxtrepltxt;?//find為查找對話框的輸入文本區,replace對話框的輸入文本區
Font?newfont;
JButton?findenterreplbbut;?//find為查找對話框,replace對話框的確定按鈕
JLabel?state=new?JLabel(“java編輯器------未命名文檔“);?//狀態欄
JTextArea?txt1;?//主輸入文本區
File?newfiles;
JPopupMenu?popm;?//彈出菜單聲明
JMenu?m1m2m3m4m5m6;?//各菜單項
JMenuItem?m61m62m26m271m34m51m52m53m54p_copyp_cutp_pastep_delfont;
int?startpendpnexttempnewstartpnewendp;?//查找替換時所用的臨時變量
JToolBar?toolbar?=?new?JToolBar();?//工具條?
JButton?newf=new?JButton(new?ImageIcon(“pic/new.gif“));?//圖標在PIC下
JButton?open=new?JButton(new?ImageIcon(“pic/open.gif“));?
JButton?save=new?JButton(new?ImageIcon(“pic/save.gif“));?
JButton?copy=new?JButton(new?ImageIcon(“pic/copy.gif“));
JButton?cut=new?JButton(new?ImageIcon(“pic/cut.gif“));?
JButton?pp=new?JButton(new?ImageIcon(“pic/pp.gif“));?
JButton?del=new?JButton(new?ImageIcon(“pic/del.gif“));?
JButton?findc=new?JButton(new?ImageIcon(“pic/find.gif“));?
JButton?color=new?JButton(new?ImageIcon(“pic/color.gif“));
JButton?help=new?JButton(new?ImageIcon(“pic/help.gif“));?
JButton?exit=new?JButton(new?ImageIcon(“pic/exit.gif“));?
myfr(String?sss)?/////構造函數開始
{
super(sss);
JMenuBar?mb=new?JMenuBar();
fname=null;?//初始文件名為空?
findenter=new?JButton(“確定“);
findenter.addActionListener(this);?//聲明對話框中上確定按鈕,并注冊事件
replb=new?JButton(“確定“);
replb.addActionListener(this);
mainpane=(JPanel)this.getContentPane();?
mainpane.setLayout(new?BorderLayout());?
txt1=new?JTextArea(““1361);
txt1.addMouseListener(new?handlemouse(this));//注冊鼠標右擊事件
txt1.setFont(new?Font(“宋體“Font.PLAIN18));
mainpane.add(txt1?BorderLayout.CENTER);?
mainpane.add(“North“toolbar);?
mainpane.add(“South“state);
JScrollPane?sll?=?new?JScrollPane();?//創建滾動條
mainpane.add(“Center“?sll);?;
sll.getViewport().add(txt1);?//將滾動條裝入文本區
popm=new?JPopupMenu();?////POPMeun?開始
p_copy=new?JMenuItem(“復制?“);
p_copy.addActionListener(this);
KeyStroke?keycopyp=KeyStroke.getKeyStroke(KeyEvent.VK_CEvent.CTRL_MASK);?
p_copy.setAccelerator(keycopyp);?
p_cut=new?JMenuItem(“剪切?“);
p_cut.addActionListener(this);
KeyStroke?keycutp=KeyStroke.getKeyStroke(KeyEvent.VK_XEvent.CTRL_MASK);?
p_cut.setAccelerator(keycutp);?
p_paste=new?JMenuItem(“粘貼?“);
p_paste.addActionListener(this);
KeyStroke?keypp=KeyStroke.getKeyS
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????677??2009-09-03?14:35??java編輯器\handlemouse.class
?????文件????????650??2009-09-03?14:35??java編輯器\myfr$1.class
?????文件???????1015??2009-09-03?14:35??java編輯器\myfr$MyFont$1.class
?????文件???????1018??2009-09-03?14:35??java編輯器\myfr$MyFont$2.class
?????文件???????1015??2009-09-03?14:35??java編輯器\myfr$MyFont$3.class
?????文件????????666??2009-09-03?14:35??java編輯器\myfr$MyFont$4.class
?????文件???????5743??2009-09-03?14:35??java編輯器\myfr$MyFont.class
?????文件??????13210??2009-09-03?14:35??java編輯器\myfr.class
?????文件???????1296??2009-09-03?14:35??java編輯器\myhelp.class
?????文件????????378??2009-09-03?14:35??java編輯器\note.class
?????文件??????23561??2009-02-18?20:22??java編輯器\note.java
?????文件????????603??2009-09-03?14:35??java編輯器\xxx.class
?????文件????????382??2009-09-03?14:35??java編輯器\xxxhelp.class
?????目錄??????????0??2010-01-25?17:04??java編輯器
-----------?---------??----------?-----??----
????????????????50214????????????????????14
- 上一篇:mysql驅動jar包
- 下一篇:android 自定義控件 小球圓周運動
評論
共有 條評論