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 4602090
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:55:43+00:00 2026-05-21T23:55:43+00:00

I am working on a GUI, and I have a routine to update the

  • 0

I am working on a GUI, and I have a routine to update the display when things change underneath:

void update() {
    if (needsUpdating) {
        // ...
        needsUpdating = false;
    }
}

I’m trying to avoid calling update() “too often” — ie, if many properties are set in succession I’d rather update() be called just once.

Is it possible to have update() called after every user input event — key/mouse/etc? I could do this manually, but I have so many event handlers and I know I’ll forget — can Java do this for me?

  • 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-21T23:55:43+00:00Added an answer on May 21, 2026 at 11:55 pm

    yes, you can globally listen to user-events, though I wouldn’t recommend it, except if you don’t find another way:

    http://tips4java.wordpress.com/2009/08/30/global-event-listeners/

    The real problem seems to be your application design:

    I could do this manually, but I have
    so many event handlers and I know I’ll
    forget

    try to model those “many” into separate parts and clearly define which part need to trigger an update at which time. Actually, there’s no way around such a model, whatever the implementation of the actual listening, once you are beyond the most trivial of applications. For starters, see f.i.

    https://softwareengineering.stackexchange.com/questions/71022/what-is-good-programming-practice-for-structuring-java-project

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

Sidebar

Related Questions

I'm currently working on a Windows Forms GUI and I have a Combo that
So I'm working on a research assignment with a gui and I have 3
I am working on Java GUI project. I have several components on the swing-based
I'm working with a GUI in PowerShell and trying to make the form such
I have banking gui application that I am currently working on and there seems
i am trying to research some gui technology for c# where i can display
I was given a working FORTRAN program and i have to write C# GUI
I'm working on a project about graph-coloring (with GUI). I have a map divided
I am working on a GUI. It is strictly for Sign-in. I have it
I have a problem with my program. I'm working on the gui, and I

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.