Results 1 to 3 of 3
  1. #1
    mallorz is offline Member
    Join Date
    Jan 2014
    Posts
    77
    Rep Power
    0

    Question JDialog - Assigning an ActionListener

    I have a program that using one JFrame which opens one of two JDialog windows depending on which button is pressed.

    How do I assign listeners to the buttons and fields on the JDialog window? I added listeners on the View end, but how do I process them? I tried adding the '..implements ActionListener" class in the main Controller but it does not recognize/hear anything.

    I hope that makes sense. If you could please be detailed, maybe with an example or link to a nice example/article or the like.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,458
    Rep Power
    25

    Default Re: JDialog - Assigning an ActionListener

    How do I assign listeners to the buttons and fields on the JDialog window
    Same way as when they are for a local button. Call the add... method with a reference to a listener.

    Post a small, complete program that compiles, executes and shows the problem if you need more help.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    mallorz is offline Member
    Join Date
    Jan 2014
    Posts
    77
    Rep Power
    0

    Default Re: JDialog - Assigning an ActionListener

    ... You know what? May have jumped the gun. Didn't add the listeners to the JDialog program! Good to know it's the same though, thank you (and I apologize). If I have a related issue after adding them I will post back.

Similar Threads

  1. Assigning text to something
    By phantomcraft in forum New To Java
    Replies: 3
    Last Post: 02-27-2013, 11:39 AM
  2. Assigning labels to JSliders?
    By Vase in forum New To Java
    Replies: 5
    Last Post: 04-05-2011, 11:37 PM
  3. Need some help with assigning & Exceptions
    By Jubic in forum New To Java
    Replies: 7
    Last Post: 06-07-2010, 05:53 AM
  4. Assigning a string value to a char
    By coffeebean in forum New To Java
    Replies: 4
    Last Post: 06-15-2008, 06:30 AM

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
  •