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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:49:43+00:00 2026-05-10T18:49:43+00:00

I have a Java Applet that uses AWT. In some (rare) circumstances, the platform

  • 0

I have a Java Applet that uses AWT. In some (rare) circumstances, the platform does not refresh the screen properly. I can move or minimize/maximize the window and see that my applet refreshed properly. I am looking for code that will give me the fullest possible applet screen repaint, simulating the behaviour of a minimize/maximize.

I’ve tried calling various combinations of paint()/repaint()/invalidate()/update() on the parent containers and recursing on various children. However, no combination (that I’ve found) cleans up the framework bugs that I am encountering. I am looking for techniques to fully refresh the applet, even if they may cause some slight flickering, as I will be invoking this code only on the problematic platform.

In my tests, moving to Swing did not help resolve my problem.

By the way, this is a simplification of my previous (more complicated) post: Java Applet, AWT Refresh problem Mac OS X 10.4

Edit: Investigation in threading did not solve this problem. Marking best answer as the good one.

  • 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. 2026-05-10T18:49:43+00:00Added an answer on May 10, 2026 at 6:49 pm

    This happens all the time if you are not programming carefully in AWT/Swing.

    First of all, you should do ALL work on the event thread. This means you can’t do any of it in your main statement (or anything it calls directly). I know every Java GUI app ever invented violates this rule, but that’s the rule.

    For the most part, they used to say you could use a non-awt thread until the window was ‘Realized’ (pack/setVisible), but Sun figured out that didn’t always work.

    Second, when you get an event on the AWT thread, be sure to return it quickly. Never sleep or execute a long operation.

    Third, (and this is an extension of ‘First’, if you get a callback that is NOT already on the AWT worker thread, be sure to put it on the AWT thread before doing anything with the GUI.

    Generally, any event generated by an AWT component will be on the correct thread. Events generated by timers, manually created threads, or the one handed to main() are not.

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

Sidebar

Ask A Question

Stats

  • Questions 64k
  • Answers 64k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I'm testing it, the free Express version. Pros Performance (caching,… May 11, 2026 at 10:58 am
  • added an answer Regarding limitations in web browsers, MSIE 6/7 do not support… May 11, 2026 at 10:58 am
  • added an answer Why not use preg_replace_callback? Specifically: preg_replace_callback('!\{continue\}(.*)\{/continue\}!Us', 'replace_continue', $html); function replace_continue($matches)… May 11, 2026 at 10:58 am

Related Questions

I have a Java Applet that uses AWT. In some (rare) circumstances, the platform
I have a paint application that runs as a Java applet. I need to
I am designing a psychology experiment with java applets. I have to make my
I have a Java swing application with a panel that contains three JComboBoxe s
I have a java back-end that needs to expose services to clients running in
I have a Java application that launches another java application. The launcher has a
I have a Java application which I want to shutdown 'nicely' when the user
I have a Java program that loads thirdparty class files (classes I did not
I have a Java process that opens a file using a FileReader. How can
I have a java class: it.eng.ancona.view.RuoliView$TabElaborazioneFattureValidazione$ElencoDettaglioElaborazioneFattureValidazione$RigaElencoDettaglioElaborazioneFattureValidazione It's so long for multiple inner class. If

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.