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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:34:37+00:00 2026-05-31T21:34:37+00:00

I have a counter in a JPanel in my java applet. I want the

  • 0

I have a counter in a JPanel in my java applet. I want the counter to update every time the int of the counter changes. How would I do this?

  • 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-31T21:34:39+00:00Added an answer on May 31, 2026 at 9:34 pm

    Make a method changeCounter that allows you to change the counter. In that method update the control in your JPanel.

    The proper way to go about this would be data binding, but afaik that’s still not in Java. There are plenty of libraries to do so, though.

    Another option would be to implement it the usual way, i.e. Observer pattern, using listeners. There is a tutorial for that, even. Generally it works that way in Swing. You have objects that themselves can fire property change events whenever one of their properties changes and you add listeners for those events to change control values accordingly (and vice versa when the user changes a value in a control).

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

Sidebar

Related Questions

I have a counter that make counter++ every time one image touches another image.
I have a counter that counts up every 1 second and add 1 to
I have a performance counter category. The counters in this category may change for
i have this problem: starting from an empty list (0 elements) i want check
I have this kind of progamming task without JavaFx, instead it's Java Swing. I
I have a counter field in a myisam table. To update the counter value
I want to have a counter that counts down from 60 seconds to 0.
I would like to have a counter, that counts backwards, and is stopped if
I am trying to have a counter (count seconds and minutes) and update it
I have implemented a counter using NobleCount like this: $('#message').NobleCount('#messageInfo',{ max_chars: max, block_negative: true

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.