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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:59:20+00:00 2026-06-17T07:59:20+00:00

I wrote a pretty basic applet program in eclipse: public class SwingAppletDemo extends JApplet

  • 0

I wrote a pretty basic applet program in eclipse:

public class SwingAppletDemo extends JApplet {

    private static final long serialVersionUID = -1935096480915162747L;
    JLabel jl;

    public void init() {
        try {
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                    new SwingAppletDemo().makeGUI();
                }
            });
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
    private void makeGUI() {

        jl = new JLabel("Press a button!");

        setLayout(new FlowLayout());

        add(jl);
    }   
}

It compiled fine and then I ran it as an applet by right-clicking on the SwingAppletDemo.java and then I selected Run As > Java Applet

The applet viewer opened but no label was displayed in it. Can anyone please tell me where did I went wrong, I referred to a few tutorials but couldn’t find the necessary info.

I also tried running it in Google Chrome but there too only an empty applet was displayed.

Thanx in advance!

  • 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-17T07:59:21+00:00Added an answer on June 17, 2026 at 7:59 am

    You are creating a new SwingAppletDemo in your init method which is never shown. You can simply replace:

    new SwingAppletDemo().makeGUI();
    

    with

    makeGUI();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty stumped here. I wrote a very basic program to test an MP3
i want to develop a pretty basic client-server program. one software reads xml (or
I'm pretty new to objective c, and having some basic problems. I wrote a
I have a class called AString . It is pretty basic: class AString {
Dependency Injection frameworks in Ruby have been pretty much declared unnecessary. Jamis Buck wrote
I think this is a pretty basic question, but here it is anyway. I
I think my question is pretty basic. I was trying to get Open CV
I'm writing a pretty basic webserver (well, trying) and while it's now serving HTML
I have a one-many relationship in my local Sqlite db. Pretty basic stuff. When
This is a pretty basic question. I am wondering if the Unreal Development Kit

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.