This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes Embedding JApplet vs Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Embedding JApplet vs Applet" Watch "Embedding JApplet vs Applet" New topic
Author

Embedding JApplet vs Applet

Joe Deluca
Greenhorn

Joined: Jan 29, 2009
Posts: 14
Hey Ranchers,

I am fairly new at creating JApplets and I am having a problem embedding my JApplet into a web page.

For testing, I just have a plain JApplet created from netbeans form builder that displays a textbox and a button.

When I try to embed the class file into a web page it doesn't show up..

Then I tried to embed a simple Applet without any user interface, just text, and it worked.

Is there a different way to imbed an applet over JApplet?

Code From Netbeans That Will Not Show up in my Web page



Code that works when embeded into a web page


HTML Page



Any Suggestions..?

SCJP 6
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
Try adding width and height attributes to the APPLET tag.


Ping & DNS - my free Android networking tools app
Joe Deluca
Greenhorn

Joined: Jan 29, 2009
Posts: 14
ya I had that originally but there was still a problem. It's strange to me seeing that the code works fine with Netbeans applet viewer.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
Strange. After adding those attributes appletviewer ran it just fine.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Embedding JApplet vs Applet
 
Similar Threads
Insert an image in JScrollPane
How to resize an application to screen size?
Networked Programs that work across countries
Pressing a button to open a new window
If-Else help please