[IT/计算机]基于Java课程设计记事本附源代码
重庆工商大学派斯学院
课程设计说明书
派斯 学院 计算机科学系 专业( 本 科) 09级 1班
课题名称:基于Java的课程设计——记事本
课程设计起止时间:
2011年 2月 6日, 2月 25日(共 3 周)
学生姓名: 张黄江 学号:2009305116
指导教师: 刘振东
目录
1需求分析........................................................................................................................................ 2
2总体设计........................................................................................................................................ 2
3详细设计&主要功能说明 ............................................................................................................. 2
3.1主窗体 ................................................................................................................................ 2
3.2标题栏 ................................................................................................................................ 3
3.3状态栏 ................................................................................................................................ 3
3.4文件菜单............................................................................................................................. 4
3.4.1打开对话框 .............................................................................................................. 4
3.4.2保存对话框 .............................................................................................................. 6
3.4.3确认退出对话框 ...................................................................................................... 7
3.5编辑菜单............................................................................................................................. 8
3.5.1剪切、复制与粘贴 .................................................................................................. 9
3.5.2查找与替换 ............................................................................................................ 10
3.6格式菜单........................................................................................................................... 12
3.6.1设置字体................................................................................................................ 12
3.6.2设置颜色................................................................................................................ 13
3.7帮助菜单........................................................................................................................... 13
3.7.1帮助主题................................................................................................................ 14
3.7.2关于........................................................................................................................ 14
3.8拖拽打开文件................................................................................................................... 15 4类示图.......................................................................................................................................... 18
5结束语.......................................................................................................................................... 18
6参考文献...................................................................................................................................... 18
7附录(源代码) .......................................................................................................................... 18
文件一(主类):NoteBook.java ........................................................................................... 18
文件二:MyNote.java ............................................................................................................ 19
文件三:ShowDialog.java ...................................................................................................... 48
文件四:FontDialog.java ........................................................................................................ 50
文件五:Help.java .................................................................................................................. 58
第1页,(共19页)
1需求分析
记事本是电脑大人常用的文本处理工具,它以简单、快捷等优点占居一定的用户量。 所以开发出功能更强大的文本处理工具是迫在眉睫的需求。
2总体设计
所有功能:打开文件(文本框打开和拖拽打开)、保存文件、另存为文件、退出程序,剪切、复制、粘贴、删除、全选、查找、替换、插入系统当前时间及显示时间,自动换行、设置字体、显示总行数和总字数。
所有菜单都有快捷键。
3详细设计&主要功能说明
3.1主窗体
布局介绍:模拟Windows 的记事本界面,增加路径显示、状态栏(自动换行、总行数、总字数以及系统当前时间)。
字数还包括被选择时选中的字数显示。
更改了文字显示颜色为:蓝色,选中文字颜色为:绿色,选中文字背景颜色为:黄色。
第2页,(共19页)
3.2标题栏
显示文件名和文件路径。
3.3状态栏
显示
内容
财务内部控制制度的内容财务内部控制制度的内容人员招聘与配置的内容项目成本控制的内容消防安全演练内容
:是否自动换行、总行数、总字数以及当前系统时间。
行数和字数通过文档监听器DocListener类监听。
//内部类:文档监听器类
private class DocListener implements DocumentListener {
public void insertUpdate(DocumentEvent iu) {
documentChanged();
}
public void removeUpdate(DocumentEvent ru) {
documentChanged();
}
public void changedUpdate(DocumentEvent cu) {
documentChanged();
}
private void documentChanged() {
if(isSaved) {
setTitle(title+" *");
}
isChanged=true;
isSaved=false;
totalWords=doc.getLength();
labelTotalLines.setText(""+text.getLineCount());
labelTotalWords.setText(""+totalWords);
}
}
时间是通过内部类Time类来实现的。它是一个线程类,即单独占用一个线程。代码如下: //内部类:时间类
private final class Time extends Thread {
public String getCurrentTime() {
SimpleDateFormat format=new SimpleDateFormat("yyyy年MM月dd日,HH:mm:ss");
return format.format(System.currentTimeMillis());
}
第3页,(共19页)
public void run() {
SimpleDateFormat format=new SimpleDateFormat("HH: mm: ss");
while(true) {
labelTime.setText(format.format(System.currentTimeMillis()));
try {
sleep(1000);
} catch (InterruptedException ie) {ie.printStackTrace();}
}
}
}
3.4文件菜单
3.4.1打开对话框
第4页,(共19页)
采用java自带的打开文件对话框,该视图为java平台。代码如下: private void openFile() { try {
JFileChooser fileChooserOpen=new JFileChooser();
fileChooserOpen.showOpenDialog(this);
if(fileChooserOpen.getSelectedFile()==null) {
name=null;
} else{name=
fileChooserOpen.getSelectedFile().getAbsoluteFile().toString();
}
}catch (HeadlessException he) {he.printStackTrace();}
if(name!=null) {
fileName=name;
if(isSaved||(doc.getLength()==0&&isNewFile)) {
text.setText(null);
if(readFile(fileName)) {
title="我的记事本- "+fileName;
setTitle(title);
isChanged=false;
isSaved=true;
isNewFile=false;
} else {
new ShowDialog(this,"提示","打开文件 "+fileName+" 失败",ShowDialog.OTHER);
}
} else {
if(new File(fileName).exists()) {
if(isChanged) {//先检查是否保存了文件
new ShowDialog(this,"确认重新打开","
检测
工程第三方检测合同工程防雷检测合同植筋拉拔检测方案传感器技术课后答案检测机构通用要求培训
到文件还没有保存,是否
保存,",ShowDialog.EXIT,temp);
if(temp.getText().equals("yes")) {
saveFile("save");
}
}
text.setText(null);
if(readFile(fileName)) {
title="我的记事本- "+fileName;
setTitle(title);
isChanged=false;
isSaved=true;
isNewFile=false;
} else {
new ShowDialog(this,"提示","打开文件 "+fileName+" 失败
",ShowDialog.OTHER);
第5页,(共19页)
}
} else {
new ShowDialog(this,"提示","打开文件 "+fileName+" 失败",ShowDialog.OTHER);
}
}
}
}
3.4.2保存对话框
采用java自带的文件对话框,Windows平台。代码如下: private Boolean saveFile(String argument) {
//argument 有2个参数:save和saveAs;
Boolean canSave=false;
if(argument.equals("save")) {
if(isNewFile) {
fileDialog=new FileDialog(this,"保存文件",FileDialog.SAVE);
fileDialog.setVisible(true);
if(fileDialog.getFile()!=null) {
canSave=true;
fileName=fileDialog.getDirectory()+fileDialog.getFile();
if(fileDialog.getFile().indexOf(".")==-1) {
fileName=fileName+".txt";//默认为文本文档
} else {}
} else {}
}else {
第6页,(共19页)
canSave=true;
}
}else if(argument.equals("saveAs")) {
fileDialog=new FileDialog(this,"另存为",FileDialog.SAVE);
fileDialog.setVisible(true);
if(fileDialog.getFile()!=null) {
canSave=true;
fileName=fileDialog.getDirectory()+fileDialog.getFile();
if(fileDialog.getFile().indexOf(".")==-1) {
fileName=fileName+".txt";//默认为文本文档
} else {}
}
}
if(canSave) {
if(writeFile(fileName)) {
isSaved=true;
isChanged=false;
isNewFile=false;
title="我的记事本- "+fileName;
setTitle(title);
labelSouth.setText("已保存");
return true;
}
}
return false;
}
3.4.3确认退出对话框
通过一个窗口监听器来监听关闭文件时文件是否保存,如果未保存,则提示保存,点击保存按钮,就弹出保存对话框,然后退出程序;点击不保存按钮,则直接退出程序;点击取消按钮,则取消“退出程序”,程序继续运行。WindowsListener是一个继承于WindowsAdapter
第7页,(共19页)
的内部类,其中只用到了public void windowClosing(WindowEvent we)一个方法,
里面的message用到了html语言的换行功能。代码如下: //内部类:窗口监听器类
private class WindowListener extends WindowAdapter {
public void windowClosing(WindowEvent we) {
if(isChanged&&doc.getLength()>0) {
String message="";
if(isNewFile) {
message="检测到文件还没有保存,
 
是否保存,";
} else {
message="检测到文件还没有保存,
是否将更改保存
"; 到"+fileName+",
}
new ShowDialog(frame,"确认退出
",message,ShowDialog.EXIT,temp);
if(temp.getText().equals("yes")) {
if(saveFile("save")) {
System.exit(0);
}
} else if(temp.getText().equals("no")) {
System.exit(0);
}
} else {
System.exit(0);
}
}
}
3.5编辑菜单
第8页,(共19页)
3.5.1剪切、复制与粘贴
剪切、复制与粘贴的功能用到了系统的剪切板,并与其共享。
实现剪切板的写入和读取操作代码如下:
public static void setSysClipboardText(String textToSysClipboard) {
//向系统剪切板写入字符串
StringSelection textTemp=new StringSelection(textToSysClipboard);
clip.setContents(textTemp,null);
}
public static String getSysClipboardText() { //获取系统剪切板上的字符串
clip=Toolkit.getDefaultToolkit().getSystemClipboard();//获取系统剪切板
Transferable clipTf=clip.getContents(null);//获取剪切板的内容
if(clipTf!=null) {
if(clipTf.isDataFlavorSupported(DataFlavor.stringFlavor)) {
try {
return
(String)clipTf.getTransferData(DataFlavor.stringFlavor);
}catch (Exception e) {
e.printStackTrace();
}
}
}
return null;
}
有了对剪切板的写入与读取操作,下面就来实现怎样操作文本域的文字。 参数argument是指剪切、复制粘贴、删除或全选的哪个操作;用变量start
记录
混凝土 养护记录下载土方回填监理旁站记录免费下载集备记录下载集备记录下载集备记录下载
所选文字的起始位置,变量end记录结束位置;剪切就是将选中的文字写入到系统剪切板,然后移除(remove())所选文字;复制就是想剪切板写入选中的文字,而保留所选;粘贴就是从剪切板上读取文字,插入(insert())到光标所在位置。
private void textEdit(String argument) {
int start=text.getSelectionStart(),
end=text.getSelectionEnd();
if(argument.equals("cut")) {//剪切
setSysClipboardText(text.getSelectedText());
try {
doc.remove(start,end-start);//移除所选文字
}catch (BadLocationException bte) {bte.printStackTrace();}
} else if(argument.equals("copy")) {//复制
setSysClipboardText(text.getSelectedText());
} else if(argument.equals("paste")) {//粘贴
try {
第9页,(共19页)
doc.remove(start,end-start);//移除所选文字
}catch (BadLocationException bte) {bte.printStackTrace();}
text.insert(getSysClipboardText(),text.getCaretPosition());
} else if(argument.equals("delete")) {//删除
try {
doc.remove(start,end-start);//移除所选文字
}catch (BadLocationException bte) {bte.printStackTrace();}
}
}
3.5.2查找与替换
用一个内部类FindDialog来创建查找对话框,并实现接口ActionListener的方法actionPerformed(),采用null布局方式,且添加状态栏,可以提示查找信息。这里主要用到一个文本域的方法indexOf()来查找位置。代码如下:
public void actionPerformed(ActionEvent ae) {
Object obj=ae.getSource();
if(obj instanceof JButton){
if(fieldFind.getText()!=null) {
strFind=fieldFind.getText();
}
if(fieldReplace.getText()!=null) {
strReplace=fieldReplace.getText();
}
if(obj.equals(buttonFindNext)) {
indexStart=text.getText().indexOf(strFind,indexFrom);
indexEnd=indexStart+strFind.length();
if(indexStart==-1) {
indexStart=text.getText().indexOf(strFind,0);
第10页,(共19页)
indexEnd=indexStart+strFind.length();
if(indexStart==-1) {
this.labelSouth.setText("\""+strFind+"\" 没有找到");
indexStart=indexEnd=-1;
} else {
text.select(indexStart,indexEnd);
indexFrom=indexEnd;
buttonReplace.setEnabled(true);
buttonReplaceAll.setEnabled(true);
}
} else {
text.select(indexStart,indexEnd);
indexFrom=indexEnd;
buttonReplace.setEnabled(true);
buttonReplaceAll.setEnabled(true);
}
} else if(obj.equals(buttonReplace)) {
if(strReplace.length()!=0) {
if(text.getSelectedText()!=null) {
text.replaceSelection(strReplace);
actionPerformed(new
ActionEvent((Object)buttonFindNext,0,null));
已替 labelSouth.setText("\""+fieldFind.getText()+"\"换为:\""+fieldReplace.getText()+"\"");
} else {
labelSouth.setText(" \""+strFind+"\" 没有找到");
}
} else {
labelSouth.setText("替换内容为空~");
}
} else if(obj.equals(buttonReplaceAll)) {
int count=0;
indexFrom=0;
if(strReplace.length()!=0) {
if(text.getSelectedText()!=null) {
while((indexStart=text.getText().indexOf(strFind,indexFrom))!=-1)
{
indexEnd=indexStart+strFind.length();
indexFrom=indexEnd;
count++;
text.replaceRange(strReplace,indexStart,indexEnd);
}
labelSouth.setText("成功将 \""+strFind+"\" 替换为\""+strReplace+"\": "+count+"处");
第11页,(共19页)
} else {
labelSouth.setText(" \""+strFind+"\" 没有找到");
}
} else {
labelSouth.setText("替换内容为空~");
}
} else if(obj.equals(buttonCancel)) {
this.setVisible(false);
}
}
}
3.6格式菜单
3.6.1设置字体
字体是FontDialog类,null布局方式,字体、字形和字号主要用到了JList类。里面包括字体、字形、字号和Tab键大小。
字体是全部支持中文的字体,字形也是常见的字形,字号从10到100,Tab键大小是手动输
第12页,(共19页)
入,没有数值限制。按钮有恢复默认、确定、取消和应用。 代码详见附件。
3.6.2设置颜色
3.7帮助菜单
第13页,(共19页)
3.7.1帮助主题
帮助主题是通过一个ShowDialog类来实现的。
中间是一个JLabel标签,利用了html语言来实现换行功能的。 里面主要写了该程序的功能,快捷键等信息。
3.7.2关于
显示了作者以及版本信息。
第14页,(共19页)
3.8拖拽打开文件
用实现DropTargetListener接口的内部类来实现拖拽打开文件的功能。 这个接口有5个需要重写的方法:
public void dragEnter(DropTargetDragEvent dtde); //拖拽进入
public void dragOver(DropTargetDragEvent dtde); //拖拽经过
public void dropActionChanged(DropTargetDragEvent dtde); //拖拽更改
public void dragExit(DropTargetEvent dte); //拖拽离开
public void drop(DropTargetDropEvent dtde); //拖拽释放
当拖拽进入的时候判断鼠标所带的参数是否符合本程序的要求,并过滤掉不符合要求的: public void dragEnter(DropTargetDragEvent dtde) {//拖拽进入
if(!dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)
&&!dtde.isDataFlavorSupported(DataFlavor.stringFlavor)) {
dtde.rejectDrag();
}
}
当鼠标拖拽释放的时候,就执行打开文件的操作。这里用到一个List类,以防拖拽过来的是多个文件。如果是多个文件,则用========================隔开每一个文件,并注明其文件名和路径。标题栏注明有多少个文件被打开了。
public void drop(DropTargetDropEvent dtde) {//拖拽释放
labelSouth.setText("拖拽打开");
dtde.acceptDrop(DnDConstants.ACTION_LINK);
第15页,(共19页)
if(dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
try {
Transferable tf=dtde.getTransferable();
List
list=(List)tf.getTransferData(DataFlavor.javaFileListFlavor);
File [] listFile=(File[])list.toArray();
for(int count=0;count0) {
for(int i=0;i0||!isNewFile)) {//先检查是否保存了文件
new ShowDialog(this,"确认新建","检测到文件还没有保存,是否保存,",ShowDialog.NEW,temp);
第31页,(共19页)
if(temp.getText().equals("yes")) {
saveFile("save");
}
}
text.setText(null);
title="我的记事本- 新建文本";
setTitle(title);
isChanged=false;
isSaved=true;
isNewFile=true;
}
/* private Boolean openFileByJar(String fileName) {
if(jar.exists()) {
String command="java -jar "+jar.getAbsolutePath()+" "+fileName;
try {
run.exec(command);
}catch(IOException ioe) {return false;}
return true;
} else {
return false;
}
}*/
private void openFile() {
String name=new String();
if(JAVA==environment) {//java平台
try {
JFileChooser fileChooserOpen=new JFileChooser();
fileChooserOpen.showOpenDialog(this);
if(fileChooserOpen.getSelectedFile()==null) {
name=null;
} else {
name=fileChooserOpen.getSelectedFile().getAbsoluteFile().toString();
}
}catch (HeadlessException he) {he.printStackTrace();}
} else if(WINDOWS==environment) {//Windows平台
fileDialog=new FileDialog(this,"打开文件",FileDialog.LOAD);
fileDialog.setVisible(true);
if(fileDialog.getFile()==null) {
name=null;
} else {
name=fileDialog.getDirectory()+fileDialog.getFile();//文件路径加文件名
}
}
if(name!=null) {
第32页,(共19页)
fileName=name;
if(isSaved||(doc.getLength()==0&&isNewFile)) {
text.setText(null);
if(readFile(fileName)) {
title="我的记事本- "+fileName;
setTitle(title);
isChanged=false;
isSaved=true;
isNewFile=false;
} else {
new ShowDialog(this,"提示","打开文件 "+fileName+" 失败",ShowDialog.OTHER);
}
} else {
if(new File(fileName).exists()) {
if(isChanged) {//先检查是否保存了文件
new ShowDialog(this,"确认重新打开","检测到文件还没有保存,是否保存,",ShowDialog.EXIT,temp);
if(temp.getText().equals("yes")) {
saveFile("save");
}
}
text.setText(null);
if(readFile(fileName)) {
title="我的记事本- "+fileName;
setTitle(title);
isChanged=false;
isSaved=true;
isNewFile=false;
} else {
new ShowDialog(this,"提示","打开文件 "+fileName+" 失败",ShowDialog.OTHER);
}
} else {
new ShowDialog(this,"提示","打开文件 "+fileName+" 失败",ShowDialog.OTHER);
}
}
}
}
private Boolean saveFile(String argument) {
//argument 有2个参数:save和saveAs;
Boolean canSave=false;
String name=new String();
第33页,(共19页)
if(argument.equals("save")) {
if(isNewFile) {
if(JAVA==environment) {//java平台
try {
JFileChooser fileChooserSave=new JFileChooser();
fileChooserSave.showSaveDialog(this);
if(fileChooserSave.getSelectedFile()==null) {
name=null;
} else {
canSave=true;
name=fileChooserSave.getSelectedFile().getAbsoluteFile().toString();
}
}catch (HeadlessException he) {he.printStackTrace();}
} else if(WINDOWS==environment) {//Windows平台
fileDialog=new FileDialog(this,"保存文件",FileDialog.SAVE);
fileDialog.setVisible(true);
if(fileDialog.getFile()==null) {
name=null;
} else {
canSave=true;
name=fileDialog.getDirectory()+fileDialog.getFile();
}
}
}else {
canSave=true;
}
}else if(argument.equals("saveAs")) {
fileDialog=new FileDialog(this,"另存为",FileDialog.SAVE);
fileDialog.setVisible(true);
if(fileDialog.getFile()!=null) {
canSave=true;
name=fileDialog.getDirectory()+fileDialog.getFile();
}
}
if(canSave) {
if(name!=null) {
fileName=name;
}
if(fileName.indexOf(".")==-1) {
fileName=fileName+".txt";//默认为文本文档
} else if(fileName.indexOf(".")0) {
String message="";
if(isNewFile) {
message="检测到文件还没有保存,
 是否保存,";
} else {
message="检测到文件还没有保存,
是否将更改保存到"+fileName+",";
}
new ShowDialog(frame,"确认退出",message,ShowDialog.EXIT,temp);
if(temp.getText().equals("yes")) {
if(saveFile("save")) {
System.exit(0);
}
} else if(temp.getText().equals("no")) {
System.exit(0);
}
} else {
System.exit(0);
}
}
}
//内部类:鼠标拖拽类
private class MouseDragging implements DropTargetListener{
public void dragEnter(DropTargetDragEvent dtde) {//拖拽进入
第45页,(共19页)
if(!dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)
&&!dtde.isDataFlavorSupported(DataFlavor.stringFlavor)) {
dtde.rejectDrag();
}
}
public void dragOver(DropTargetDragEvent dtde) {//拖拽经过
labelSouth.setText("可以拖拽多个文件到该窗口");
}
public void dropActionChanged(DropTargetDragEvent dtde) {//拖拽更改
labelSouth.setText("拖拽更改");
}
public void dragExit(DropTargetEvent dte) {//拖拽离开
labelSouth.setText("拖拽离开");
}
@SuppressWarnings("unchecked")
public void drop(DropTargetDropEvent dtde) {//拖拽释放
labelSouth.setText("拖拽打开");
dtde.acceptDrop(DnDConstants.ACTION_LINK);
if(dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
try {
Transferable tf=dtde.getTransferable();
List
list=(List)tf.getTransferData(DataFlavor.javaFileListFlavor);
File [] listFile=(File[])list.toArray();
for(int count=0;count
表
关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf
listStyle,//字形列表
listSize;//字号列表
private JTextField
fieldFont,
fieldStyle,
fieldSize,
fieldTabSize;//Tab的长度
private JCheckBox
chBoxAutoWrap,//自动换行
chBoxFirstWordUp,//首字母大写
chBoxUnderLine;//下划线
private JLabel labelShow;//示例
private String [] fontName=new String[19];//字体名
private String [] styleName={"正常","粗体","斜体","粗斜体"};//风格名
private String [] sizeName//字号名
={"10","12","15","17","20","22","25","32","40","56","72","100"};
第51页,(共19页)
private Font font;//字体
private int
nameIndex=0,//存放当前字体的索引信息
styleIndex=0,
sizeIndex=0;
private JButton
recoverDefault,
ok,
cancel,
apply,
foreColor,//前景色
backColor,//背景色
selectedTextColor,//选中文字颜色
selectionColor,//选中区域颜色
caretColor;//光标颜色
private JComponent com;
private JTextArea comJTA;
private Container con=getContentPane();
/////////////////////////////////////////
FontDialog(JComponent com) {
this(com,null);
}
FontDialog(JComponent com,JLabel temp) {
this.com=com;
this.comJTA=(JTextArea)com;
setTitle("设置字体");
setModal(true);
this.font=com.getFont();
recoverDefault=new JButton("恢复默认");
ok=new JButton("确定");
ok.setSelected(true);
cancel=new JButton("取消");
apply=new JButton("应用");
foreColor=new JButton("字体颜色");
backColor=new JButton("背景色");
selectedTextColor=new JButton("选中文字颜色");
selectionColor=new JButton("选中区域颜色");
caretColor=new JButton("光标颜色");
recoverDefault.addActionListener(this);
ok.addActionListener(this);
cancel.addActionListener(this);
第52页,(共19页)
apply.addActionListener(this);
foreColor.addActionListener(this);
backColor.addActionListener(this);
selectedTextColor.addActionListener(this);
selectionColor.addActionListener(this);
caretColor.addActionListener(this);
//字体
JLabel labelFont=new JLabel("字体:");
fieldFont=new JTextField(font.getName());
fieldFont.selectAll();
GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
String[] fontName=ge.getAvailableFontFamilyNames();
for(int i=0;i一、[文件操作:]
1.新建文件,
2.打开文件,
3.保存文件,
4.另存为文件,
5.退出程序"
+"
二、[编辑操作:]
1.剪切,
2.复制,
3.粘贴,
4.删除,
5.全选
6.查找&替换
7.插入当前时间"
+"
三、[格式操作:]
1.自动换行,
2.设置字体(字体,字形,字号)
",
newFunction="【新增功能】"
+"
1、拖拽打开文件
可以同时打开一个或多个文件"
+"
2、时间显示
同步显示系统时间,
让你能够随心所欲的掌握时间"
+"
3、行数与字数显示
4、不能执行的步骤,菜单不可选
"
+"
5、菜单快捷键(由动作事件和按键事件构成)
常用的操作都集成了快捷键:"
+"
CTRL+N:新建文件
CTRL+O:打开文件
CTRL+S:保存文件
"
+"
CTRL+X:剪切
CTRL+C:复制
CTRL+V:粘贴
CTRL+A:全选"
第58页,(共19页)
+"
CTRL+F:查找
F3:查找一下
CTRL+R:替换
CTRUL+I:插入当前时间
"
+"
CTRL+L:切换自动换行
CTRL+T:设置字体
"
+"
【布局】
模拟Windows记事本布局方式
有菜单栏、任务栏,有弹出式菜单"
+"
每次打开总是在屏幕的中间位置显示
每个对话框也是在其父窗口的中间显示
";
static public String
help=""
+baseFunction+"
"+newFunction
+"
";
static String
name="程序名称:我的记事本",
version="版本:1.0",
author="作者:蓝枫影",
copyRight="CopyRight: 2010- 2011",
terrace="开发平台:JBuilder2008";
static public String
about=""
+name+"
"+version+"
"+author+"
"+copyRight+"
"+terrace
+"";
}
第59页,(共19页)
本文档为【[IT/计算机]基于Java课程设计记事本附源代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
格式:doc
大小:444KB
软件:Word
页数:100
分类:生活休闲
上传时间:2017-09-30
浏览量:18