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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:34:17+00:00 2026-06-16T18:34:17+00:00

I experiment with my applet using Eclipse and its Applet Viewer. The Applet Viewer

  • 0

I experiment with my applet using Eclipse and its Applet Viewer. The Applet Viewer appears on the top of Eclipse and during Applet execution I click on Eclipse icon to maximize it from task bar. Then Applet Viewer loses the focus and Applet.stop() gets called.

When I minimize Eclipse, Applet Viewer goes to front again, gains focus and Applet.start() gets called. This ends up in a complete mess.

Is it normal behavior for a browser to call Applet.stop once user changes to another Tab or minimizes the browser Can I disable that, I want stop never been called.

Maybe I am missing something in threads.

My code is something like this:

public class AppletApp extends JApplet {

    public void init() {
        super.init();
        System.out.println("AppletApp.init()");
    }

    public void start() {
        System.out.println("AppletApp.start()");

        try {
            SwingUtilities.invokeAndWait(new Runnable() {
                @Override
                public void run() {
                    getContentPane().add(new JLabel("Test Label"));
                }
            });
        } catch (InterruptedException e) {
        } catch (InvocationTargetException e) {}

        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                //For DJ Browser Component
                NativeSwing.initialize();
                NativeInterface.open();

                //connect to server and start message exchange
                Client.init(userInterface);
                userInterface.authenticate();

                NativeInterface.runEventPump();
            }
        };
        Thread t = new Thread(runnable);
        t.start();
    }

    public void stop() {
        System.out.println("AppletApp.stop()");
    }

    public void destroy() {
        System.out.println("AppletApp.destroy()");
    }
}
  • 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-06-16T18:34:18+00:00Added an answer on June 16, 2026 at 6:34 pm

    Is it normal behavior for a browser to call Applet.stop once user
    changes to another Tab or minimizes the browser?

    Yes it is normal. From the javadoc:

    Called by the browser or applet viewer to inform this applet that it
    should stop its execution. It is called when the Web page that
    contains this applet has been replaced by another page, and also just
    before the applet is to be destroyed.

    When you switch tab, I consider that the containing web page has been replaced hence it is logical that stop() is invoked.

    Can I disable that, I want stop never been called.

    No you can’t, you don’t have control on that. However, you could rely on the init() and the destroy() methods instead of start() and stop(). start() and stop() are meant for resuming/pausing anything that consumes resources which are not necessary if not visible (for example an animation is pointless if not visible).

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

Sidebar

Related Questions

As an experiment we want to build our products using the Eclipse java compiler
I have a Java applet that downloads data from where it's hosted, using HTTP.
I'm looking to experiment with developing an Outlook plugin. I'm using the express edition
// inheritence experiment #includestdafx.h #include<iostream> using namespace std; class base { private: int i;
My empirical experiment shows that if I setSpan(o, start, end) from start to end
I experiment with the table layout using one of the documented examples. With a
I'm starting to experiment with the new chart controls in System.Windows.Controls.DataVisualization.Charting (from the Silverlight
Here's a little experiment I ran in an Oracle database (10g). Aside from (Oracle's)
Simple experiment: I created an entity model from Northwind, and find that the generated
someone experiment the same error while downloading CSV quotes from Yahoo!Finance web service ?

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.