import javax.swing.border.EmptyBorder;
import java.awt.Component;
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
import com.sun.java.swing.plaf.windows.*;
public class textFrame extends JFrame {
//变量
JMenu mnuFile = new JMenu();
private JPanel contentPane;
static Page page;
JMenu menu_2;
JMenuItem onTop;
int OnTopNum = 0;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
textFrame frame = new textFrame();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public textFrame() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 850, 426);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu file = new JMenu("\u6587\u4EF6");
menuBar.add(file);
JMenuItem newText = new JMenuItem("\u65B0\u5EFA");
newText.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
file.add(newText);
JMenuItem open = new JMenuItem("\u6253\u5F00");
open.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
file.add(open);
JMenuItem save = new JMenuItem("\u4FDD\u5B58");
save.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.SaveDocument();
}
});
file.add(save);
JMenuItem otherSave = new JMenuItem("\u53E6\u5B58\u4E3A");
otherSave.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.SaveAsDocument();
}
});
file.add(otherSave);
JSeparator separator = new JSeparator();
file.add(separator);
JMenuItem menuItem_17 = new JMenuItem("\u6587\u4EF6\u52A0\u5BC6");
file.add(menuItem_17);
JMenuItem menuItem_20 = new JMenuItem("\u6570\u636E\u89E3\u5BC6");
file.add(menuItem_20);
JMenuItem menuItem_13 = new JMenuItem("\u6570\u636E\u52A0\u5BC6");
file.add(menuItem_13);
JMenuItem menuItem = new JMenuItem("\u5C5E\u6027\u8BBE\u7F6E");
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new wordEdit();
}
});
file.add(menuItem);
JSeparator separator_2 = new JSeparator();
file.add(separator_2);
JMenu menu_8 = new JMenu("\u6700\u8FD1\u6253\u5F00");
file.add(menu_8);
JMenuItem menuItem_18 = new JMenuItem(
"\u6E05\u9664\u6700\u8FD1\u6253\u5F00...");
menu_8.add(menuItem_18);
JSeparator separator_1 = new JSeparator();
menu_8.add(separator_1);
JMenuItem exit = new JMenuItem("\u9000\u51FA");
file.add(exit);
JMenu menu_1 = new JMenu("\u7F16\u8F91");
menuBar.add(menu_1);
JMenuItem undo = new JMenuItem("\u64A4\u6D88");
undo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.Undo();
}
});
menu_1.add(undo);
JMenuItem redo = new JMenuItem("\u91CD\u505A");
redo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.Redo();
}
});
menu_1.add(redo);
JSeparator separator_7 = new JSeparator();
menu_1.add(separator_7);
JMenuItem selectAll = new JMenuItem("\u5168\u9009");
selectAll.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.SelectAll();
}
});
menu_1.add(selectAll);
JMenuItem cut = new JMenuItem("\u526A\u5207");
cut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.Cut();
}
});
menu_1.add(cut);
JMenuItem copy = new JMenuItem("\u590D\u5236");
copy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.Copy();
}
});
menu_1.add(copy);
JMenuItem menuItem_28 = new JMenuItem("\u7C98\u8D34");
menu_1.add(menuItem_28);
JSeparator separator_8 = new JSeparator();
menu_1.add(separator_8);
JMenuItem find = new JMenuItem("\u67E5\u627E");
menu_1.add(find);
JMenuItem replace = new JMenuItem("\u66FF\u6362");
menu_1.add(replace);
JMenuItem clear = new JMenuItem("\u6E05\u9664");
clear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
page.DeleteAll();
}
});
menu_1.add(clear);
menu_2 = new JMenu("\u89C6\u56FE");
menu_2.addMouseListener(new MouseAdapter() {
public void mouseExited(MouseEvent e) {
}
});
menuBar.add(menu_2);
JMenuItem fullScr = new JMenuItem("\u5168\u5C4F");
menu_2.add(fullScr);
JMenuItem menuItem_11 = new JMenuItem("\u663E\u793A\u6BD4\u4F8B");
menu_2.add(menuItem_11);
JMenu menu_5 = new JMenu("\u5DE5\u5177\u680F");
menu_2.add(menu_5);
JMenuItem menuItem_2 = new JMenuItem("\u5E38\u7528\u5DE5\u5177");
menu_5.add(menuItem_2);
JMenuItem menuItem_12 = new JMenuItem("\u5907\u4EFD\u7BA1\u7406");
menu_2.add(menuItem_12);
JMenuItem menuItem_9 = new JMenuItem("\u6587\u6863\u7BA1\u7406\u5668");
menu_2.add(menuItem_9);
JMenuItem menuItem_7 = new JMenuItem("\u5B9A\u4F4D\u5668");
menu_2.add(menuItem_7);
JMenu menu_7 = new JMenu("\u6A21\u5F0F");
menu_2.add(menu_7);
JMenuItem menuItem_8 = new JMenuItem("\u8BB0\u4E8B\u672C");
menu_7.add(menuItem_8);
JMenuItem mntmWord = new JMenuItem("WORD");
menu_7.add(mntmWord);
JMenuItem blackColor = new JMenuItem("\u6587\u672C\u80CC\u666F");
blackColor.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
Color newColor=JColorChooser.showDialog(new JFrame(),"调色板",page.editor.getBackground());
page.setBackColor(newColor);
}
});
menu_2.add(blackColor);
JMenu menu_3 = new JMenu("\u683C\u5F0F");
menuBar.add(menu_3);
JMenuItem word = new JMenuItem("\u5B57\u4F53");
word.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
new word();
}
});
menu_3.add(word);
JMenuItem menuItem_48 = new JMenuItem("\u81EA\u52A8\u6362\u884C");
menu_3.add(menuItem_48);
JMenu menu_4 = new JMenu("\u5DE5\u5177");
menuBar.add(menu_4);
JMenuItem menuItem_33 = new JMenuItem(
"\u4E2D\u6587\u7B80\u7E41\u4F53\u8F6C\u6362");
menu_4.add(menuItem_33);
JMenuItem menuItem_34 = new JMenuItem("\u5B57\u6570\u7EDF\u8BA1");
menu_4.add(menuItem_34);
JMenuItem menuItem_35 = new JMenuItem("\u8BA1\u7B97\u5668");
menu_4.add(menuItem_35);
JMenuItem menuItem_36 = new JMenuItem("\u4E66\u7B7E");
menu_4.add(menuItem_36);
JMenuItem menuItem_6 = new JMenuItem("\u622A\u56FE\u5DE5\u5177");
menu_4.add(menuItem_6);
JMenuItem menuItem_38 = new JMenuItem("\u653E\u5927\u955C");
menu_4.add(menuItem_38);
JMenu menu_6 = new JMenu("\u5E2E\u52A9");
menuBar.add(menu_6);
onTop = new JMenuItem("\u603B\u5728\u6700\u524D");
onTop.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (OnTopNum % 2 == 0) {
setAlwaysOnTop(true);
onTop.setText("取消总在最前");
}
else {
setAlwaysOnTop(false);
onTop.setText("总在最前");
}
OnTopNum++;
}
});
menu_6.add(onTop);
JMenu mnlauguage = new JMenu("\u8BED\u8A00(Lauguage)");
menu_6.add(mnlauguage);
JMenuItem menuItem_43 = new JMenuItem("\u7B80\u4F53\u4E2D\u6587");
mnlauguage.add(menuItem_43);
JMenuItem mntmEnglish = new JMenuItem("English");
mnlauguage.add(mntmEnglish);
JMenuItem menuItem_42 = new JMenuItem("\u5E2E\u52A9\u6587\u6863");
menu_6.add(menuItem_42);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(new BorderLayout(0, 0));
JPanel panel = new JP
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
wordEdit.rar (58个子文件)
wordEdit
.project 384B
bin
Page$RedoAction.class 2KB
word$5.class 1KB
textFrame$20.class 652B
textFrame$4.class 659B
word$6.class 730B
textFrame$14.class 1KB
textFrame$22.class 653B
textFrame$2.class 588B
textFrame$12.class 658B
Page$UndoAction.class 2KB
wordEditor.class 3KB
textFrame$24.class 585B
Page$OpenRTFThread.class 1KB
textFrame$13.class 558B
textFrame$25.class 1KB
textFrame$11.class 653B
textFrame_exit_actionAdapter.class 623B
wordEditor$1.class 801B
textFrame$15.class 615B
word$7.class 561B
textFrame$10.class 652B
textFrame$9.class 656B
word$4.class 556B
textFrame$3.class 588B
Page.class 7KB
textFrame$16.class 924B
editordocument_documentAdapter.class 896B
word.class 4KB
Page$SaveThread.class 1KB
Page$OpenTXTThread.class 2KB
textFrame.class 12KB
Page$UndoHandler.class 1KB
textFrame$21.class 654B
textFrame$8.class 651B
word$2.class 553B
textFrame$7.class 651B
textFrame$6.class 617B
wordEdit.class 3KB
wordEdit$1.class 777B
textFrame$23.class 653B
word$1.class 736B
textFrame$17.class 661B
Page$Filter.class 701B
textFrame$5.class 661B
textFrame$18.class 658B
wordEdit$2.class 554B
textFrame$1.class 692B
word$3.class 553B
textFrame$19.class 653B
.settings
org.eclipse.jdt.core.prefs 629B
calculator.jar 63KB
src
wordEdit.java 4KB
word.java 4KB
textFrame.java 15KB
Page.java 10KB
wordEditor.java 4KB
.classpath 301B
共 58 条
- 1
资源评论
gccdchen
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功