资源简介
自己用java写的一个多文档记事本程序,基本功能都实现了的 。有什么不足之处,还请各位多多提宝贵意见。

代码片段和文件信息
package com.notepad2;
import java.awt.Desktop;
import java.awt.event.*;
import java.beans.PropertyVetoException;
import java.text.DateFormat;
import java.util.Date;
import javax.swing.JColorChooser;
import javax.swing.JDesktopPane;
import javax.swing.JDialog;
public class Action
{
static JDesktopPane desktop=null;
//新建文件
public static ActionListener newFileAction()
{
return new ActionListener(){
public void actionPerformed(ActionEvent e) {
Createframe frame=new Createframe(nulltruetruetruetrue);
frame.textArea.requestFocusInWindow();
}
};
}
//打开文件
public static ActionListener openFileAction()
{
return new ActionListener(){
public void actionPerformed(ActionEvent e) {
Createframe frame;
if(NotePadframe.getDesktop().getAllframes().length==0)
{
frame=new Createframe(nulltruetruetruetrue);
if(frame==null)return;
try {
frame.openFile();
frame.textArea.requestFocusInWindow();
} catch (Throwable e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}else
{
frame=(Createframe) NotePadframe.getDesktop().getSelectedframe();
if(frame==null)return;
if(frame.textArea.getText().equals(““))
{
try {
frame.openFile();
frame.textArea.requestFocusInWindow();
} catch (Throwable e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}else
{
frame=new Createframe(nulltruetruetruetrue);
try {
frame.openFile();
frame.textArea.requestFocusInWindow();
} catch (Throwable e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
};
}
//保存文件
public static ActionListener saveFileAction()
{
return new ActionListener(){
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
Createframe frame=(Createframe) NotePadframe.getDesktop().getSelectedframe();
if(frame==null) return;
try {
frame.saveFile();
frame.textArea.requestFocusInWindow();
} catch (Throwable e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
};
}
//另存为
public static ActionListener saveAsFileAction()
{
return new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
Createframe frame=(Createframe) NotePadframe.getDesktop().getSelectedframe();
if(frame==null) return;
try {
frame.saveAsFile();
frame.textArea.requestFocusInWindow();
} catch (Throwable e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
};
}
//关闭全部窗口
public static ActionListener closeAllframes()
{
return new ActionListener(){
@Override
public void actionPerformed(Acti
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3476 2012-08-29 21:00 image\ti
文件 989 2012-08-23 21:34 image\toolbar\copy.png
文件 975 2012-08-23 21:34 image\toolbar\cut.png
文件 1005 2012-08-29 19:53 image\toolbar\find.png
文件 948 2012-08-23 21:34 image\toolbar\newFile.png
文件 1022 2012-08-23 21:34 image\toolbar\openFile.png
文件 1019 2012-08-23 21:57 image\toolbar\paste.png
文件 992 2012-08-23 21:33 image\toolbar\redo.png
文件 1013 2012-08-23 21:34 image\toolbar\saveAll.png
文件 977 2012-08-23 21:34 image\toolbar\saveFile.png
文件 993 2012-08-23 21:33 image\toolbar\undo.png
文件 9066 2012-10-21 18:14 notepad2\Action.java
文件 31187 2012-10-21 18:16 notepad2\NotePad2.java
目录 0 2012-10-17 13:45 image\toolbar
目录 0 2012-10-17 13:45 image
目录 0 2012-10-22 12:38 notepad2
----------- --------- ---------- ----- ----
53662 16
相关资源
- java图片浏览器跨平台运行程序与源码
- 基于java的在线考试系统-毕业设计
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
评论
共有 条评论