开发者

How to put an applet that is written with Netbeans into a html file?

开发者 https://www.devze.com 2023-01-08 03:47 出处:网络
I have written an applet that connects mysql. Since i connect mysql it uses additional library.(JDBC Driver for MySQL (Connector/J)) When i finished writing a开发者_C百科nd try to run on Netbeans ther

I have written an applet that connects mysql. Since i connect mysql it uses additional library.(JDBC Driver for MySQL (Connector/J)) When i finished writing a开发者_C百科nd try to run on Netbeans there is no problem but i did not figure how to put that class into a html file. Do i have to put whole netbeans project up or what should i do?


Read this tutorial from Sun/Oracle

  1. Package as jar
  2. Create jnlp
  3. Create HTML


Make the main class extends JApplet

Build the project

Find the jar

Then add this code to your HTML

<applet code = '<appletClassName>' 
    archive = '<jarFilePath.jar>', 
    width = xxx, 
    height = yyy />


If you have the JDBC driver set up in the Netbeans project properties, all you have to do is build the project and then go into your NetbeansProjects folder (wherever your Project folder is) and open up the build folder. It should have a sample HTML document along with the necessary files to run the applet.

0

精彩评论

暂无评论...
验证码 换一张
取 消