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
- Package as jar
- Create jnlp
- 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.
精彩评论