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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:12:40+00:00 2026-05-29T11:12:40+00:00

Applet used to work, but now it will not. I am not very experienced

  • 0

Applet used to work, but now it will not. I am not very experienced with GUI’s much less Applets.
Here is the GUI code:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;

public class StockGUI extends JApplet implements ActionListener
{
private final String sPASS = "abc123";
//Stock oStock = new Stock();
//StockInput oStockInput = new StockInput();

//////////////////////////////////////////////////////////

JPanel jPanel;
JPasswordField jPass;
JButton jBEnter, jBYes, jBNo;
JTextArea jTAInput, jTACurrent;
JTextField jTxtField;
JLabel jLEnterP, jLQue, jLCurrent;
JScrollPane jScroll;




public void init()
{
    getContentPane().setLayout(null);
    jPanel = new JPanel();  jPanel.setSize(500,1500);

    ////////////////////////////////////////////////

    jPass = new JPasswordField(20);
    jPass.setActionCommand(sPASS);
    jLEnterP = new JLabel("Enter Password:");
    jPanel.add(jLEnterP);
    jPanel.add(jPass);

    jPass.addActionListener(new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            String cmd = e.getActionCommand();
            if(cmd.equals(sPASS))
            {
                char[] cAry = jPass.getPassword();
                if(isPassword(cAry))
                {
                    doPass();
                }
            }
        }
    });

    getContentPane().add(jPanel, BorderLayout.CENTER);

}

public void actionPerformed(ActionEvent e)
{
    String cmd = e.getActionCommand();


    if(cmd.equals("Yes"))
    {

        doInput();

    }
    if(cmd.equals("No") || cmd.equals("Done"))
    {
        doMain();
    }

}

public void doPass()
{
        jPanel.removeAll();
        jLQue = new JLabel("Do you need to input more data?");
        jBYes = new JButton("Yes");

        jBYes.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                doInput();
            }
        });

        jBNo = new JButton("No");

        jBNo.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                doMain();
            }
        });

        jPanel.add(jLQue);
        jPanel.add(jBYes);
        jPanel.add(jBNo);
        refresh();

}

public void doInput()
{
    jPanel.removeAll();
    jLQue = new JLabel("Enter Data:");
    jTAInput = new JTextArea(25,50);
    jLCurrent = new JLabel("Current Data");
    jTACurrent = new JTextArea(25, 25);
        jTACurrent.setEditable(false);
        //jTACurrent.setText(oStockInput.getList());
    jScroll = new JScrollPane(jTACurrent);
    jPanel.add(jLQue);
    jPanel.add(jTAInput);
    refresh();
}

public void doMain()
{

    jPanel.removeAll();
    jPanel.add(new JLabel("HELLO WORKD!!"));
    refresh();

}

public void refresh()
{
    jPanel.repaint();
    jPanel.revalidate();
    super.validate();
    super.repaint();
}

public boolean isPassword(char[] cAry)
{

    return Arrays.equals(cAry, sPASS.toCharArray());

}

The HTML Code:

//  <html>
//<body>
//<p align=center>
//<applet code="StockGUI.class" width=500 height=1500>
//  </applet>
//</p>
//</body>
//</html>

I get no errors on compile. I am trying to use Anonymous Classes for the ActionListeners, but this is the first time I have used them. When I launch it Chrome, all it shows is a white background. Any help would be good. 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-29T11:12:41+00:00Added an answer on May 29, 2026 at 11:12 am

    Check the Java Console. It is likely to provide the cause of the failure.

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

Sidebar

Related Questions

I am a Apple developer that used to work with UIImages and photography. Now
I have a sandboxed Applet, but that should not make a difference. The Applet
The following code used to work for me in the past. I'm trying it
The following code is used for playing a sound file in my java applet:
I've seen similar questions to this but not too many definitive answers... I used
I have a problem when call applet method from javascript.. I used this function
I've used the reachability code provided by apple and created a UIAlert that displays
I have an applet which have to read a file from server. But I
I have used the NameAndPassword Auth Plugin sample code from Apple to create my
I have been browsing the apple docs and stackoverflow for a while now, but

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.