Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to create a Right Click Menu for a Text Field in Java?

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Thanked 0 Times in 0 Posts

    Question How to create a Right Click Menu for a Text Field in Java?

    I am a novice Java programmer. I was trying to edit a Java application, the application basically is a download manager. It has a text field where in we have to paste the URL to download that particular file. Now my problem is that I am trying to add a mouse event so that I can right click and "paste" the URL into the Text Field. I would also like to add "cut" and "copy" options for the right click. But I have tried many things and failed to achieve what I wanted.

    It would be of great help if anyone could help me get it this done by giving me an example of the code. I would like to know the simplest way to get a "cut", "copy" & "paste" menu by right clicking on a text field.

    Thank you.

  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    My Mood
    Thanked 263 Times in 232 Posts

    Default Re: How to create a Right Click Menu for a Text Field in Java?

    Welcome daemon0
    Most people are too busy to sit down and write working code samples for every person. See what you can come up with and post questions if you get stuck.
    Are you using JText--things or creating your own boxes for input?

Similar Threads

  1. Replies: 1
    Last Post: May 18th, 2013, 11:28 PM
  2. Text inside Text Field
    By JosPhantasmE in forum Java Theory & Questions
    Replies: 1
    Last Post: March 16th, 2013, 05:29 AM
  3. validating java text field
    By payal in forum AWT / Java Swing
    Replies: 1
    Last Post: July 24th, 2012, 12:41 AM
  4. Create a JText field upon button click
    By jo15765 in forum AWT / Java Swing
    Replies: 3
    Last Post: May 28th, 2012, 07:06 PM
  5. Tic Tac Toe Java Application Help w/ Importing Text Field
    By Big Bundy in forum What's Wrong With My Code?
    Replies: 10
    Last Post: March 30th, 2011, 02:08 AM