91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

Java 實現(xiàn)的記事本程序,程序里有很多的注釋,非常容易理解。 實現(xiàn)的功能有:文件的新建,打開,另存為,退出;復制,剪切,刪除,粘貼,查找,替換,自動換行,統(tǒng)計單詞;設置字體大小,粗細,字體顏色等。 內(nèi)含課程設計報告,絕對排版規(guī)范。

資源截圖

代碼片段和文件信息

import?java.awt.*;
import?java.awt.event.*;
import?java.io.*;
import?java.util.*;
import?javax.swing.*;

public?class?note?
{
public?static?void?main(String[]?args)
{
myfr?fr=new?myfr(“JAVA記事本“);
fr.setSize(560395);
}
}
///////////////////////////myfr主窗體類//////////////////////////////////////
class?myfr?extends?Jframe?implements?ActionListener
{
String?strstrnextpathfname;?//部分變量的聲明
JPanel?mainpane;
JFileChooser?choose?=?new?JFileChooser();?//文件對話框
Dialog?findreplace;?//find為查找對話框,replace對話框
JTextField?findtxtrepltxt;?//findtxt為查找對話框的輸入文本區(qū),repltxt對話框的輸入文本區(qū)
Font?newfont;
JButton?findenterreplb;?//find為查找對話框,replace對話框的確定按鈕
JLabel?state=new?JLabel(“?JAVA記事本------未命名文檔“);?//狀態(tài)欄
JTextArea?txt1;?//主輸入文本區(qū)
File?newfiles;
JPopupMenu?popm;?//彈出菜單聲明
JMenu?m1?m2?m3?m4;
JMenuItem?m26m271m34p_copyp_cutp_pastep_del;
int?startpendpnexttempnewstartpnewendp;?//查找替換時所用的臨時變量
JToolBar?toolbar?=?new?JToolBar();?//工具條

JButton?newf=new?JButton(new?ImageIcon(“pic/new.png“));?//圖標在PIC下
JButton?open=new?JButton(new?ImageIcon(“pic/open.png“));
JButton?save=new?JButton(new?ImageIcon(“pic/save.png“));
JButton?copy=new?JButton(new?ImageIcon(“pic/copy.png“));
JButton?cut=new?JButton(new?ImageIcon(“pic/cut.png“));
JButton?pp=new?JButton(new?ImageIcon(“pic/pp.png“));
JButton?del=new?JButton(new?ImageIcon(“pic/del.png“));
JButton?findc=new?JButton(new?ImageIcon(“pic/find.png“));
JButton?count?=?new?JButton(new?ImageIcon(“pic/count.png“));
JButton?help?=?new?JButton(new?ImageIcon(“pic/help.png“));

myfr(String?sss)?/////構造函數(shù)開始
{
super(sss);

//歡迎消息對話框
JOptionPane.showMessageDialog(null“歡迎使用Java記事本程序“);

JMenuBar?mb=new?JMenuBar();

fname=null;?//初始文件名為空
findenter=new?JButton(“確定“);?//find為查找對話框,replace對話框的確定按鈕
findenter.addActionListener(this);?//聲明對話框中上確定按鈕,并注冊事件
replb=new?JButton(“確定“);?//replace對話框的確定按鈕
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();?//創(chuàng)建滾動條
mainpane.add(“Center“?sll);?;
sll.getViewport().add(txt1);?//將滾動條裝入文本區(qū)


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.getKeyStroke(KeyEvent.VK_VEvent.CTRL_MASK);
p_p

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????20483??2011-09-14?16:29??Java記事本源碼和課程設計報告\note.java

?????文件?????278528??2011-09-16?10:43??Java記事本源碼和課程設計報告\實習報告.doc

?????目錄??????????0??2011-09-18?15:08??Java記事本源碼和課程設計報告

-----------?---------??----------?-----??----

???????????????299011????????????????????3


評論

共有 條評論