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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:16:15+00:00 2026-05-16T20:16:15+00:00

I have the following problem. My J2ME app goes totally dead. I though it

  • 0

I have the following problem. My J2ME app goes totally dead. I though it was a deadlock, but using NetBeans’ built-in functionality, it couldn’t find such.

After some time however, it started throwing out the following messages in the console:

8242276 - CORE - CRITICAL - 2 - **event queue 3 full, dropping event
8242284 - CORE - CRITICAL - 2 - **event queue 3 full, dropping event
8242292 - CORE - CRITICAL - 2 - **event queue 3 full, dropping event
8242340 - CORE - CRITICAL - 2 - **event queue 3 full, dropping event
8242540 - CORE - CRITICAL - 2 - **event queue 3 full, dropping event
8242628 - CORE - CRITICAL - 1 - **event queue 3 full, dropping event
8242636 - CORE - CRITICAL - 1 - **event queue 3 full, dropping event
8242644 - CORE - CRITICAL - 1 - **event queue 3 full, dropping event

And so forth.

Any ideas as to what might be the case if it is not deadlock (at leats NetBeans says so) would be highly appreciated.

Thanks!

  • 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-16T20:16:16+00:00Added an answer on May 16, 2026 at 8:16 pm

    When you use AWT or Swing, there is a special thread running in the background, called the EventQueue. When you add a listener to a component (such as an ActionListener to a JButton) and the event listener method (such as actionPerformed) the method is executed on the EventQueue thread. You can choose to execute something on the EventQueue thread when the current thread isn’t the EventQueue thread by running

    EventQueue.invokeLater(new Runnable(){ //this could also be SwingUtilities.invokeLater() instead
        public void run(){
            ...
        }
    });
    

    This is great. The problem comes when you have a an event over and over and over. When this happens, the EventQueue thread can’t execute code for the previous event fast enough to execute code for the next event. So it sticks the event into a queue while it waits for the current event-handler to finish. This might happen when you do a big operation, such as reading from a file, on the EventQueue thread. For example:

    ActionListener l = new ActionListener(){
        public void actionPerformed(ActionEvent ae){
            try {
                BufferedReader in = new BufferedReader(new FileReader("foo.txt"));
                StringBuffer sb = new StringBuffer();
                char[] buf = new char[4096];
                int n;
                while (-1 != (n = in.read(buf))){
                    sb.append(buf, 0, n);
                }
                in.close();
                String s = sb.toString();
                jTextPane1.setText(s);
            } catch (IOException ioe){
                ioe.printStackTrace();
            }
    
        }
    };
    jButton1.addActionListener(l);  
    

    All the code inside actionPerformed is executed on the EventQueue thread. No other events could be processed until that code completed. If foo.txt is a big file, then it will be a while before the code completes. This means that every time you click jButton1 before the code finished, it will add the new event to the EventQueue. So if you repeatedly clicked jButton1, then there would be more and more events to add to the queue. You couldn’t overflow it this way, because the you couldn’t click fast enough, and for long enough without giving up. But if and event such as a mouse move, that occurs at every pixel, leads to a heavy-event. Then that can cause a huge EventQueue queue and it can even cause the EventQueue to overflow. A way to fix this problem might be to start another thread as soon as the event occurs. For example:

    final Runnable r = new Runnable() {
        public void run() {
            try {
                BufferedReader in = new BufferedReader(new FileReader("foo.txt"));
                StringBuffer sb = new StringBuffer();
                char[] buf = new char[4096];
                int n;
                while (-1 != (n = in.read(buf))) {
                    sb.append(buf, 0, n);
                }
                in.close();
                final String s = sb.toString();
                EventQueue.invokeLater(new Runnable(){
                    public void run(){
                        jTextPane1.setText(s);
                    }
                });
            } catch (IOException ioe) {
                ioe.printStackTrace();
            }
        }
    };
    ActionListener l = new ActionListener(){
        public void actionPerformed(ActionEvent ae){
            new Thread(r).start();
        }
    };
    jButton1.addActionListener(l);  
    

    The reason it would be necessary to invoke something on the EventQueue thread, such as in

    EventQueue.invokeLater(new Runnable(){
        public void run(){
            jTextPane1.setText(s);
        }
    });  
    

    Is because otherwise the screen wouldn’t be updated. For example, if maintaining a progress bar, EventQueue.invokeLater() would update the screen NOW, but if it isn’t wrapped in EventQueue.invokeLater(), then it will wait until the thread finishes before it updates the screen. That is useless when it comes to progress bars. In this case it probably didn’t do much.

    Thanx for a great question!

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

Sidebar

Related Questions

I have following problem: I have built a tabbar application with 4 tabs. I
I am using GWT/JAVA for development. I have following problem: I want to remove
I have the following problem. I have embedded a map using Google Maps' API.
HI Guys, I have following problem. I'm trying to connect from my Iphone app
I am a new programmer... i have following problem.. Terminating app due to uncaught
I have following problem. I worked two days on a solution but I cannot
I have following problem with using cucumber and jRuby under windows: load error: bundler/definition
I have following problem: my Query with joins contains all the nesessary data but
I have following problem: When I use std::vector with built-ins i don't get a
I have following problem: I have to make a ASP.NET Webapplication with a two-row

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.