Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-20-2007, 04:26 PM   #1
Registered: Jul 2006
Posts: 41

Rep: Reputation: 15
java applets

For a standalone application, I wrote a Java class which extends JFrame. When I execute it, it works well, the content I want to display appears as a pop-up window. Now, I want to display the same content in the web browser as an applet. Searching on the internet, I thought I found the way to implement it. I built a new class RunApplet in a file as below:

import java.awt.*;
import java.applet.*;

public class RunApplet extends Applet {
public void init() {
GameGUI myA = new GameGUI();

GameGUI is my class which extends JFrame. Then I wrote an htm file as below:

<head><title>Network Project</title></head>
<applet code="RunApplet.class" width=750 height=700></applet>

When I write the URL in address bar, there is displayed nothing on web browser. It says Applet is started, however no content is displayed. What is wrong with my code? Any ideas??..
My knowledge of Java is really limited..I really need help..Thanks..
Old 05-20-2007, 04:49 PM   #2
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Frame in applet is browser's window.
You can directly add any component to applet, because it extends panel.

import java.awt.*;
import java.applet.*;

public class RunApplet extends Applet {
  public void init() {
	add(new Button("Hello!"));


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
, won't appear in Java applets JussiKp Linux - General 3 12-08-2006 04:51 AM
Need Help In Oragainzing The Java Applets mema_UAE Programming 3 05-01-2006 01:56 PM
How do I use java applets? brooks_45 Linux - Newbie 6 02-01-2006 06:47 PM
java applets nOOb1kanobee Linux - Newbie 1 02-25-2004 03:47 AM
java applets not working... siva_bhavani General 4 09-29-2003 11:08 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration