Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Embedding JApplet vs Applet

 
Joe Deluca
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding width and height attributes to the APPLET tag.
 
Joe Deluca
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange. After adding those attributes appletviewer ran it just fine.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!