Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25
  1. #21
    sgthale is offline Member
    Join Date
    Apr 2011
    Posts
    48
    Rep Power
    0

    Default

    DOH I feel stupid for asking so many questions but basically I still cant get it working even if I try to handle it like an object. I made my

    Java Code:
    Input input = new Input();
    but I dont know where to add the "addMouseListener(this);"

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    It needs to be added to a component in the GUI that will have the focus. You can call the add method anywhere that has a reference to both the component and to the mouse listener class.

  3. #23
    sgthale is offline Member
    Join Date
    Apr 2011
    Posts
    48
    Rep Power
    0

    Default

    I feel stupid for asking so many questions but I have in my Main class

    Java Code:
    Input input = new Input();
    and i dont know where to put the "addMouseListener(this);". Right after I make the Input object or in the Input class?

  4. #24
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    You can call the add method anywhere that has a reference to both the component and to the mouse listener class.
    theComponentWithFocus.addMouseListener(theListener Class);

  5. #25
    sgthale is offline Member
    Join Date
    Apr 2011
    Posts
    48
    Rep Power
    0

    Default

    OKAY I GOT IT. Thanks. Even though it was very confusing on the way....

Page 2 of 2 FirstFirst 12

Similar Threads

  1. quick question
    By biggerthanblue in forum New To Java
    Replies: 2
    Last Post: 04-10-2011, 04:33 AM
  2. Quick Question...
    By FatalSylence in forum New To Java
    Replies: 4
    Last Post: 10-15-2010, 02:38 PM
  3. Quick question
    By sAntA199 in forum New To Java
    Replies: 2
    Last Post: 12-09-2009, 03:01 AM
  4. quick question
    By vouslavous in forum Java Applets
    Replies: 4
    Last Post: 04-24-2009, 08:35 PM
  5. Quick Question
    By Spenc in forum New To Java
    Replies: 3
    Last Post: 09-22-2008, 02:26 PM

Tags for this Thread

Posting Permissions

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