java商品管理系统5

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

packagecom.gui;importjava.awt.event.*;importjava.io.BufferedReader;importjava.io.BufferedWriter;importjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileReader;importjava.io.FileWriter;importjava.io.IOException;importjavax.swing.JFileChooser;/****@author__USER__*/publicclassNotePadextendsjavax.swing.JFrameimplementsActionListener{/**CreatesnewformNotePad*/publicNotePad(){initComponents();//注册监听this.itemCopy.addActionListener(this);this.itemZhuangTai.addActionListener(this);this.itemSave.addActionListener(this);this.itemPaste.addActionListener(this);this.itemOpen.addActionListener(this);this.itemNew.addActionListener(this);this.itemCut.addActionListener(this);this.itemDelete.addActionListener(this);this.itemExit.addActionListener(this);this.itemFont.addActionListener(this);this.mPaste.addActionListener(this);this.mCut.addActionListener(this);this.mCopy.addActionListener(this);this.mDelete.addActionListener(this);this.setLocationRelativeTo(null);//窗体显示位置}/**Thismethodiscalledfromwithintheconstructorto*initializetheform.*WARNING:DoNOTmodifythiscode.Thecontentofthismethodis*alwaysregeneratedbytheFormEditor.*///GEN-BEGIN:initComponents//editor-folddefaultstate=collapseddesc=GeneratedCodeprivatevoidinitComponents(){popMenu=newjavax.swing.JPopupMenu();mCut=newjavax.swing.JMenuItem();mCopy=newjavax.swing.JMenuItem();mPaste=newjavax.swing.JMenuItem();mDelete=newjavax.swing.JMenuItem();jScrollPane1=newjavax.swing.JScrollPane();ta=newjavax.swing.JTextArea();jMenuBar1=newjavax.swing.JMenuBar();mFile=newjavax.swing.JMenu();itemNew=newjavax.swing.JMenuItem();itemOpen=newjavax.swing.JMenuItem();itemSave=newjavax.swing.JMenuItem();jSeparator1=newjavax.swing.JSeparator();itemExit=newjavax.swing.JMenuItem();mEdit=newjavax.swing.JMenu();itemCut=newjavax.swing.JMenuItem();itemCopy=newjavax.swing.JMenuItem();itemPaste=newjavax.swing.JMenuItem();itemDelete=newjavax.swing.JMenuItem();mStyle=newjavax.swing.JMenu();itemFont=newjavax.swing.JMenuItem();mSee=newjavax.swing.JMenu();itemZhuangTai=newjavax.swing.JMenuItem();mHelp=newjavax.swing.JMenu();jMenuItem1=newjavax.swing.JMenuItem();jMenuItem2=newjavax.swing.JMenuItem();mCut.setText(\u526a\u5207);popMenu.add(mCut);mCopy.setText(\u590d\u5236);popMenu.add(mCopy);mPaste.setText(\u7c98\u8d34);popMenu.add(mPaste);mDelete.setText(\u5220\u9664);popMenu.add(mDelete);//setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);ta.setColumns(20);ta.setRows(5);ta.addMouseListener(newjava.awt.event.MouseAdapter(){//为鼠标注册监听publicvoidmouseReleased(java.awt.event.MouseEventevt){taMouseReleased(evt);}});jScrollPane1.setViewportView(ta);mFile.setText(\u6587\u4ef6(F));itemNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,java.awt.event.InputEvent.CTRL_MASK));itemNew.setText(\u65b0\u5efa);mFile.add(itemNew);itemOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,java.awt.event.InputEvent.CTRL_MASK));itemOpen.setText(\u6253\u5f00);mFile.add(itemOpen);itemSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,java.awt.event.InputEvent.CTRL_MASK));itemSave.setText(\u4fdd\u5b58);mFile.add(itemSave);mFile.add(jSeparator1);itemExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E,java.awt.event.InputEvent.CTRL_MASK));itemExit.setText(\u9000\u51fa);mFile.add(itemExit);jMenuBar1.add(mFile);mEdit.setText(\u7f16\u8f91(E));itemCut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X,java.awt.event.InputEvent.CTRL_MASK));itemCut.setText(\u526a\u5207);mEdit.add(itemCut);itemCopy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,java.awt.event.InputEvent.CTRL_MASK));itemCopy.setText(\u590d\u5236);mEdit.add(itemCopy);itemPaste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V,java.awt.event.InputEvent.CTRL_MASK));itemPaste.setText(\u7c98\u8d34);mEdit.add(itemPaste);itemDelete.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE,java.awt.event.InputEvent.CTRL_MASK));itemDelete.setText(\u5220\u9664);mEdit.add(itemDelete);jMenuBar1.add(mEdit);mStyle.setText(\u683c\u5f0f(O));itemFont.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F,java.awt.event.InputEvent.CTRL_MASK));itemFont.setText(\u5b57\u4f53);mStyle.add(itemFont);jMenuBar1.add(mStyle);mSee.setText(\u67e5\u770b(V));itemZhuangTai.setText(\u72b6\u6001\u680f);mSee.add(itemZhuangTai);jMenuBar1.add(mSee);mHelp.setText(\u5e2e\u52a9(H));jMenuItem1.setText(\u4ea7\u770b\u5e2e\u52a9);mHelp.add(jMenuItem1);jMenuItem2.setText(\u5173\u4e8e\u8bb0\u4e8b\u672c);mHelp.add(jMenuItem2);jMenuBar1.add(mHelp);setJMenuBar(jMenuBar1);javax.swing.GroupLayoutlayout=newjavax.swing.GroupLayout(getContentPane());getContentPane().setLayout(layout);layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1,javax.swing.GroupLayout.Alignment.

1 / 9
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功