I have created a desktop application, so I am planning to use distribute the software by dist.zip from project folder. when I run the program from netbeans everything works fine. when I open the launch.jnlp file the frame will open but it doesnt listen to the actionlistener and nothing is displayed, but the jar file is working. But if I open the jar file instead of jnlp file the .class files are opening. But It runs from command prompt
java -jar projectname.jar
The application has connections to database. Where would be the error?
Here is a JNLP that I use successfully.
<?xml version="1.0" encoding="utf-8"?>
<jnlp
codebase="http://www.domain.com/tools"
href="livechat.jnlp">
<information>
<title>Live Chat</title>
<vendor>vendor</vendor>
<homepage href="www.domain.com"/>
<description>Live Chat Application</description>
<icon href="images/logo.png"/>
<icon kind="splash" href="images/logo.png"/>
<shortcut online="true">
<desktop/>
<menu submenu="sub menu name"/>
</shortcut>
</information>
<security>
<all-permissions/>
</security>
<update check="always" policy="always"/>
<resources>
<j2se version="1.6+" java-vm-args="-esa -Xnoclassgc"/>
<jar href="lib/livechat-100.jar"/>
</resources>
<application-desc main-class="package.mainclass"/>
</jnlp>
the way this is set up is the jnlp file is stored at www.domain.com\tools\ and the jar file is stored at www.domain.com\tools\lib\
At this line you want to locate your main class. if you use a package (com.domain.application) you would use com.domain.application.mainclass
otherwise you would just put your mainclass in the quotes.
<application-desc main-class="package.mainclass"/>
Be sure that you sign your jar file also. Jar Signing
You don't have to create an XML. If you open notepad and paste that into a blank page then save it as filename.jnlp it would save correctly.
Your JNLP file depends a lot on your file structure for the web server/server your storing it on, as well as your package name of your application (if you created one) for example:
I will create a java applet named applet1 with the following info: package: com.digitalck.applet1 mainclass: Applet1.java (your main class is the file that contains your public static void main() method) server structure: www.domain.com/tools/lib
I will store the jnlp file in www.domain.com/tools and the SIGNED jar file in www.domain.com/tools/lib
IN THE JNLP FILE:
codebase="domain.com/tools"
href="livechat.jnlp"> (this assumes the file is in my codebase location)
<jar href="lib/livechat-100.jar"/>
<application-desc main-class="com.digitalck.applet1.Applet1"/>
Hopefully that helps to clarify, I've shown the main points to modify to get yours to work correctly without knowing any other information about your application/applet or how you are storing the files.