Results 1 to 5 of 5
  1. #1
    micolord is offline Member
    Join Date
    Sep 2011
    Location
    Philippines
    Posts
    41
    Rep Power
    0

    Default JTextField event help

    Can you please show me a very simple (short if possible) JTextField that when you CLICK output shows "you click the jtextfield".

    I've been searching searching for the right event for the JTextField and I cannot find anything ):

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: JTextField event help

    Look at the API and search for addMouse.
    Everything that extends Component (which is basically everything on your GUI) can have a MouseListener added to it.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    micolord is offline Member
    Join Date
    Sep 2011
    Location
    Philippines
    Posts
    41
    Rep Power
    0

    Default Re: JTextField event help

    One does not simply give tutorial links on a beginner X) Fixed it anyway using MouseEvent.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: JTextField event help

    That's not a tutorial.
    It's the API.
    It's the single most important document a Java developer can have access to.

    I also pointed you to exactly the correct part, which you apparently also found by some other means?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: JTextField event help

    Quote Originally Posted by micolord View Post
    One does not simply give tutorial links on a beginner
    Why not? Did you think that the purpose of a forum is to spoonfeed?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 6
    Last Post: 02-25-2012, 04:35 AM
  2. Replies: 3
    Last Post: 11-14-2011, 05:13 AM
  3. Replies: 0
    Last Post: 08-30-2011, 09:18 AM
  4. having trouble with event handling and JTextField
    By v1nsai in forum New To Java
    Replies: 5
    Last Post: 06-01-2009, 02:19 PM
  5. Replies: 1
    Last Post: 01-30-2009, 06:44 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
  •