@@ -312,8 +312,8 @@ public void actionPerformed(ActionEvent e) {
312312 mntmCopy .setAccelerator (KeyStroke .getKeyStroke (KeyEvent .VK_C , ActionEvent .CTRL_MASK ));
313313 mntmCopy .addActionListener (new ActionListener () {
314314 public void actionPerformed (ActionEvent e ) {
315-
316- str = textArea .getSelectedText ();
315+ textArea . copy ();
316+ // str = textArea.getSelectedText();
317317 }
318318 });
319319 mntmCopy .setIcon (new ImageIcon ("C:\\ Users\\ rahul\\ Downloads\\ copy.jpg" ));
@@ -323,11 +323,12 @@ public void actionPerformed(ActionEvent e) {
323323 mntmCut .setAccelerator (KeyStroke .getKeyStroke (KeyEvent .VK_X , ActionEvent .CTRL_MASK ));
324324 mntmCut .addActionListener (new ActionListener () {
325325 public void actionPerformed (ActionEvent e ) {
326-
326+ textArea .cut ();
327+ /*
327328 str = textArea.getSelectedText();
328329 n = textArea.getText().indexOf(str);
329330 textArea.replaceRange("", n, str.length());
330-
331+ */
331332 }
332333 });
333334 mntmCut .setIcon (new ImageIcon ("C:\\ Users\\ rahul\\ Downloads\\ cut(1).jpg" ));
@@ -337,9 +338,9 @@ public void actionPerformed(ActionEvent e) {
337338 mntmPaste .setAccelerator (KeyStroke .getKeyStroke (KeyEvent .VK_V , ActionEvent .CTRL_MASK ));
338339 mntmPaste .addActionListener (new ActionListener () {
339340 public void actionPerformed (ActionEvent e ) {
340-
341- position = textArea .getCaretPosition ();
342- textArea .insert (str , position );
341+ textArea . paste ();
342+ // position = textArea.getCaretPosition();
343+ // textArea.insert(str, position);
343344 }
344345 });
345346 mntmPaste .setIcon (new ImageIcon ("C:\\ Users\\ rahul\\ Downloads\\ paste.jpg" ));
0 commit comments