Results 1 to 3 of 3
  1. #1
    eleda is offline Member
    Join Date
    Sep 2010
    Posts
    4
    Rep Power
    0

    Default Stop action event in JDialog

    Hello,

    I have a poblem with stoppping an action event in a JDialog. The dialog has a panel and the panel has two buttons. When the first button is clicked and an event was performed, I want to cancel the event of that button by pressing the second button. The problem is I cannot clicked the second button while the event of the pressed first button is still occuring.

    Can somebody explain why.

    Thanks!

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default

    You have to create a new thread in the listener method. If not, you are blocking the EDT (event dispatch thread).
    Now, you can easily stopping the event by stopping the thread in listener two :)

  3. #3
    eleda is offline Member
    Join Date
    Sep 2010
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Replies: 3
    Last Post: 08-19-2010, 08:27 AM
  2. Use stop button to stop moving (stop timers) on JPanel
    By mneskovic in forum New To Java
    Replies: 3
    Last Post: 07-23-2010, 12:50 PM
  3. checking for an event during an event
    By infinity in forum AWT / Swing
    Replies: 22
    Last Post: 04-09-2009, 01:08 AM
  4. Action Event and Listeners
    By lost1 in forum New To Java
    Replies: 3
    Last Post: 11-14-2007, 04:26 AM
  5. help with jdialog
    By leonard in forum AWT / Swing
    Replies: 1
    Last Post: 08-05-2007, 05:37 AM

Posting Permissions

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