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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:36:01+00:00 2026-06-07T00:36:01+00:00

Hı, I have a java applet. On Eclıpse ıt runs perfectly and displays all

  • 0

Hı, I have a java applet. On Eclıpse ıt runs perfectly and displays all the swing items but when I embed it to the html, the applet does not display or it displays just a few of the items in the browser. Below is my code. Can somebody please help me with my problem?

import java.applet.Applet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;

import java.applet.*;
import java.net.*;
public class TestApplet extends JApplet implements ActionListener {

    Button talkToAllButton;
    Button sendPhotoToAll;
    int Tikla1Basim, Tikla2Basim;
    JLabel header;

    JLabel statusLabel;
    JLabel posLabel;
    JLabel idLabel;
    JLabel iDLabel;
    JLabel heartRateLabel;
    JLabel heartRateLabel2;
    JLabel backgroundLabel;
    JButton sendPicButton;
    JButton talkOnOffButton;
    public void init() {

        this.setLayout(null);
        setSize(1200, 900);


        idLabel=new JLabel(new ImageIcon(getImage(getDocumentBase(), "res/call_sign.png")));
        idLabel.setFont(new Font("Serif", Font.BOLD, 20));
        idLabel.setBackground(Color.white);
        idLabel.setForeground(Color.black);
        idLabel.setOpaque(true);
        idLabel.setBounds(getWidth()-190,200,180,50);
        //idLabel.setBorder(border);
        add(idLabel);

        iDLabel=new JLabel("NONE",JLabel.CENTER);
        iDLabel.setFont(new Font("Serif", Font.BOLD, 20));
        iDLabel.setBackground(new Color(36,48,24));
        iDLabel.setForeground(Color.WHITE);
        iDLabel.setOpaque(true);
        iDLabel.setBounds(getWidth()-190,250,180,50);
        //iDLabel.setBorder(border);
        add(iDLabel);

        statusLabel=new JLabel(new ImageIcon(getImage(getDocumentBase(), "res/status_alive.png")));
        statusLabel.setFont(new Font("Serif", Font.BOLD, 20));
        statusLabel.setBackground(Color.green);
        statusLabel.setForeground(Color.black);
        statusLabel.setOpaque(true);
        statusLabel.setBounds(getWidth()-190,300,180,50);
        //statusLabel.setBorder(border);
        add(statusLabel);

        posLabel=new JLabel("NO DATA");
        posLabel.setFont(new Font("Serif", Font.BOLD, 20));
        posLabel.setHorizontalAlignment(SwingConstants.CENTER);
        posLabel.setBackground(Color.green);
        posLabel.setForeground(Color.WHITE);
        posLabel.setOpaque(true);
        posLabel.setBounds(getWidth()-190,350,180,70);
        //posLabel.setBorder(border);
        add(posLabel);

        heartRateLabel=new JLabel(new ImageIcon(getImage(getDocumentBase(), "res/hearth_rate.png")));
        heartRateLabel.setFont(new Font("Serif", Font.BOLD, 20));
        heartRateLabel.setBackground(Color.red);
        heartRateLabel.setForeground(Color.black);
        heartRateLabel.setOpaque(true);
        heartRateLabel.setBounds(getWidth()-190,450,180,50);
        //heartRateLabel.setBorder(border);
        add(heartRateLabel);

        heartRateLabel2=new JLabel("NO DATA",JLabel.CENTER);
        heartRateLabel2.setFont(new Font("Serif", Font.BOLD, 20));
        heartRateLabel2.setBackground(new Color(180,2,2));
        heartRateLabel2.setForeground(Color.WHITE);
        heartRateLabel2.setOpaque(true);
        heartRateLabel2.setBounds(getWidth()-190,500,180,50);
        //heartRateLabel2.setBorder(border);
        add(heartRateLabel2);

        sendPicButton=new JButton(new ImageIcon(getImage(getDocumentBase(), "res/send_pic.png")));
        sendPicButton.setFont(new Font("Serif", Font.BOLD, 20));
        sendPicButton.setBackground(Color.red);
        sendPicButton.setForeground(Color.black);
        sendPicButton.setOpaque(true);
        sendPicButton.setBounds(getWidth()-190,580,180,50);
        //sendPicButton.setBorder(border);
        add(sendPicButton);
        sendPicButton.addActionListener(this);

        talkOnOffButton=new JButton(new ImageIcon(getImage(getDocumentBase(), "res/talk_off.png")));
        talkOnOffButton.setFont(new Font("Serif", Font.BOLD, 20));

        talkOnOffButton.setOpaque(true);
        talkOnOffButton.setBounds(getWidth()-190,650,180,50);
        //talkOnOffButton.setBorder(border);
        add(talkOnOffButton);
        talkOnOffButton.addActionListener(this);
        //***********************************************************
        //isFpsLimited = true;
        backgroundLabel=new JLabel(new ImageIcon(getImage(getDocumentBase(), "res/bg.png")));
        backgroundLabel.setOpaque(true);
        backgroundLabel.setBounds(getWidth()-200,0,200,800);
        add(backgroundLabel);

        ImageIcon headerImg=new ImageIcon(getImage(getDocumentBase(),"res/erlink_header.png"));
        header=new JLabel(headerImg);
        header.setBounds(-45, -40, 1800, 200);

        add(header);
        sendPhotoToAll = new Button("Send Photo(All)");
        sendPhotoToAll.setBounds(850,40, 150, 50);
        header.add(sendPhotoToAll);
        talkToAllButton = new Button("Talk(All)");
        talkToAllButton.setBounds(850,90, 100, 50);
        header.add(talkToAllButton);

        sendPhotoToAll.addActionListener(this);
        talkToAllButton.addActionListener(this);
        /*sendPhotoToAll.setLocation(10, 10);
        sendPhotoToAll.setSize(150, 30);

        talkToAllButton.setLocation(10, 40);
        talkToAllButton.setSize(250, 30);*/

    }

    public void actionPerformed(ActionEvent event) { 
    //event things
    }
    // TODO overwrite start(), stop() and destroy() methods
}
  • 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-07T00:36:03+00:00Added an answer on June 7, 2026 at 12:36 am
    1. Use layouts.
    2. Call validate() after all components are added.
    3. Construct the GUI on the EDT. See Concurrency in Swing for more details.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good afternoon all, I have a Java applet that I wish to embed on
I have a java applet that runs fine locally on my desktop computer. but
I have a client application which runs as a Java applet from a user's
I'm have a Java app that also runs as an applet. The app also
I have a java applet for uploading files to server. I want to display
We have a memory intensive java applet that runs in IE. The client is
I have a java applet in which I have to display a large amount
I have written a Java applet class and made a small HTML page to
i have written an Java Applet, which is loaded in HTML and its function
I have created a simple applet and HTML document, but when I open the

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.