Results 1 to 3 of 3

Thread: Deploy Issue

  1. #1
    ninjalord918 is offline Member
    Join Date
    Jul 2010
    Posts
    30
    Rep Power
    0

    Default Deploy Issue

    Hi, I'm trying to deploy my java swing app to jnlp. This is what I've attempted to do.
    I ran SwingApp.java in eclipse and it works fine.
    Java Code:
    import java.awt.FlowLayout;
    import javax.swing.*;
    public class SwingApp extends JFrame
    {
    	public static void main(String[] args)
    	{
    		JFrame frame = new JFrame("Texts");
    		frame.setSize(400,400);
    		JTextArea jt = new JTextArea("Hello world");
    		frame.add(jt);
    		frame.setVisible(true);
    
    	}
    }
    Then, I created a jar file with the following command.
    jar cf swingapp.jar SwingApp.java
    After that I create a jnlp file
    Java Code:
    <?xml version="1.0" encoding="UTF-8"?>
       <jnlp href="my_applet.jnlp">
         <information>
           <title>Swing App</title>
           <vendor>My App</vendor>
           <offline-allowed />
         </information>
         <resources>
           <j2se version="1.6+"
                 href="http://java.sun.com/products/autodl/j2se" />
           <jar href="http://127.0.0.1/swingapp.jar" />
         </resources>
         <applet-desc 
             name="Swing App"
             main-class="com.mycompany.MyApplet"
             width="300"
             height="300">
         </applet-desc>
       </jnlp>
    Finally, the html file.
    Java Code:
    <HTML>
    <HEAD>
    <TITLE> Swing App </TITLE>
    </HEAD>
    <BODY>
        <script src="http://www.java.com/js/deployJava.js"></script>
        <script> 
            var attributes = { code:'gameinterface.HelloWorld',  width:300, height:300} ; 
            var parameters = {jnlp_href: 'swingapp.jnlp'} ; 
            deployJava.runApplet(attributes, parameters, '1.6'); 
        </script>
    </BODY>
    </HTML>
    But when I open the html with a browser, it doesn't work. What did I do wrong?

  2. #2
    cselic is offline Senior Member
    Join Date
    Apr 2010
    Location
    Belgrade, Serbia
    Posts
    278
    Rep Power
    5

    Default

    Do you have any JNLP Client (for example Java Web Start or OpenJNLP)?

  3. #3
    ninjalord918 is offline Member
    Join Date
    Jul 2010
    Posts
    30
    Rep Power
    0

Similar Threads

  1. Cannot deploy app clients
    By eevictim in forum NetBeans
    Replies: 0
    Last Post: 03-10-2010, 11:44 PM
  2. JAR deploy vs. Applets
    By clydedoris in forum New To Java
    Replies: 1
    Last Post: 03-01-2010, 09:18 AM
  3. How to deploy
    By rahul999 in forum Advanced Java
    Replies: 0
    Last Post: 08-31-2008, 08:13 AM
  4. deploy a web application
    By Peter in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 02:45 PM
  5. Hot deploy en WS 6
    By Eric in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 06-27-2007, 04:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •