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

  • SEARCH
  • Home
  • 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 671321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:21:39+00:00 2026-05-14T00:21:39+00:00

I would like to have a window with a simple form (radio buttons and

  • 0

I would like to have a window with a simple form (radio buttons and so on). Users can make there selections and press a “Submit” button. Additionally to that I would like to set some time limits. In more details, user should see how many seconds he/she still have (so, there should be a timer). If the time limit is exceeded, program close the window and submit a “default” selection.

As far as I understand I need to generate 2 threads for that. One will monitor the user activity in the window (which radio button is selected and so on).

Another thread should create a timer which check the remaining time every second and put this information, in some way, into the window.

Moreover, these two thread should be able to kill each other. For example, if the “Submit” button is pressed, the first thread kills the timer. Or if the time is exceeded the second thread (timer) kill the first process.

Is it a good architecture? I need your opinion since I do such kind of things for the first time.

  • 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-05-14T00:21:39+00:00Added an answer on May 14, 2026 at 12:21 am

    While being somewhat awkward, it is possible for two threads to kill each other.

    However, I don’t think you need two threads.

    You can use a Swing timer (see this tutorial) to run the clock. When you click “Submit” you can stop the timer by invoking its stop() method. The beauty is that Swing timers run on the GUI thread so you don’t get the concurrency headache.

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

Sidebar

Related Questions

I have a general question. I would like to have a window containing some
I would like to have a button in my window such that if I
I have a window which is hidden and I would like to send a
I have a Chrome app that opens a popup window. I would like it
I have this line: $(#clients-edit-wrapper).height($(window).height()-150); I would like to apply that height function to
I would like to have a resize indication on a windows forms Form (the
I have an ASP.NET page with a simple form and a submit button. Upon
I have a form that I use in my CMS that I would like
I would like to have a Windows 2003 server fire a script to fire
I have a Windows Service and I would like to see what it's doing

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.