Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Basic code for Xcode web app?

I need to make a web app in Xcode. What are the basic lines of code for doing so?

1 Answer

Relevance
  • Robert
    Lv 6
    9 years ago
    Favorite Answer

    Start Xcode with a New Project which is a Java Web Start Application and the main bit of Java code will look a bit like:

    //

    // JavaWebStartApplication.java

    // JavaWebStartApplication

    //

    // Copyright (c) 2012, __MyCompanyName__. All rights reserved.

    //

    // A simple Web Start application

    //

    import java.awt.*;

    import java.net.*;

    import javax.swing.*;

    import javax.jnlp.*;

    public class JavaWebStartApplication {

    public static void main(String args[]) {

    try {

    System.out.println("Attempting to open www.apple.com in your browser.");

    URL apple = new URL("http://www.apple.com");/

    BasicService bs =

    (BasicService)ServiceManager.lookup(

    "javax.jnlp.BasicService");

    bs.showDocument(apple);

    } catch(UnavailableServiceException unavailableserviceexception) {

    JOptionPane.showMessageDialog(null, "This functionality is only available when this application is launched with Java Web Start.", "", 0);

    } catch(MalformedURLException malformedurlexception) { }

    }

    }

Still have questions? Get your answers by asking now.