Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8403083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:15:02+00:00 2026-06-09T22:15:02+00:00

I am creating a java desktop application.I have two button create and cancel. if

  • 0

I am creating a java desktop application.I have two button “create” and “cancel”. if i press create it will create a report in a new window. my problem is on “cancel” button. if the user press the create button it will take some time to create a new report. the cancel button should work only in the creation time. if the user presses cancel button, the report creation action should abort. i add action listener to create and cancel button but when i click create i am not able to click cancel button simultaneously.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:15:03+00:00Added an answer on June 9, 2026 at 10:15 pm

    Try running each process in a separate thread. The reason cancel won’t work is create takes time to finish its process. In that time it hogs the main thread and halts any actions (including the cancel button) that could otherwise be taken by other UI elements.

    Your cancel button is probably working. But each time you click on it, the event that gets fired is put into the back of the queue for processing behind the create button’s event. By putting the handling of the event in a separate thread and synchronizing any resources needed by both buttons (as long as those resources are thread safe!), you should be able to stop the thread created by the event button easily with the cancel button.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When creating a new project in netbeans, if i select JAVA Desktop application, it
I am creating a Java desktop application where the user will enter his name
I have a java desktop application for which I am trying to create a
I am creating java desktop application. in the application i want to create many
im creating a java application with netbeans. i have two jframes for login and
I am creating a Java Desktop Application that is going to have a Firewall.
I am creating a java desktop application. In the application I generate report using
I'm creating a Java desktop application and was wondering how I should deal with
I'm creating a java desktop application that draws a map in a JFrame designing
I am creating a Java application that will take in .tar files and retrieve

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.