Results 1 to 3 of 3
  1. #1
    MarbenOrallo is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default Enable mouse right click menu pop up.

    Hi All,
    I am new in this forum an I am very interested to learn java and netbeans.
    How can I enable the mouse right click pop up menu over JFrame ?,
    because I can not copy the text inside my JTextArea by using my mouse,
    When I highlight the text inside my JtextArea and right click my mouse, there is no pop up to be used to copy the highlighted text .
    I am using netbeans IDE 7.1

    Thanks in advance.


    sincerely,
    Marbs

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  3. #3
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Enable mouse right click menu pop up.

    When I highlight the text inside my JtextArea and right click my mouse, there is no pop up to be used to copy the highlighted text .
    There is no default popup with copy/cut/paste functionality. You need to create your own as suggested above.

    Creating the menu items can easily be done by using the default Actions provided with the editor kit:

    Java Code:
    pupup.add( new JMenuItem( new DefaultEditorKit.CopyAction() );
    Also, I believe, the setComponentPopupMenu(...) method can be used instead of the code suggested from the "Bringing Up a Popup Menu" section of the tutorial.

Similar Threads

  1. Mouse Click not working.
    By itcmanish in forum AWT / Swing
    Replies: 1
    Last Post: 01-12-2012, 04:25 PM
  2. Mouse click interrupting animation
    By rolledback in forum Java 2D
    Replies: 17
    Last Post: 06-17-2011, 12:01 AM
  3. How to enable save as option in menu after the application has been launched
    By plenitude in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 12-26-2008, 10:31 AM
  4. mouse click alert
    By amir in forum AWT / Swing
    Replies: 1
    Last Post: 08-05-2008, 11:42 PM
  5. Problem in mouse click n repaint
    By Preethi in forum New To Java
    Replies: 4
    Last Post: 07-04-2008, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •