How to launch my java application in a web browser?

Hi. I try to launch my java application, e.g. "HellowWorld.java", using web browser.
1. How can I change my java application program to java applet in general way?
I read "Java: An Introduction to Computer Science and Programming, Third Edition"
by Walter Savitch and found page 803 - "Converting a Swing application to an applet".
My question is how I can know which class should be removed or not such as using JApplet instead of JFrame. Are there general rules about this?
2. I found "AWT only" tutorial had some example lauching application using "AppletButton".
How can I use this method to launch "HelloWorld.class"?
http://java.sun.com/docs/books/tutorial/information/download.html#OLDui
(after extracting zip file) -> ../OLDui/layout/card.html
3. (continued 2) Can I use above method to embed applet into web browser?
For example, java Swing application -> applet using "AppletButton" -> web browser using "<applet></applet>" tag.
I'd appreciate any partial anwers of these questions or other suggestions.
Thanks.

Thanks! Here is what I got from your help.
* HelloWorldSwing.java is a 1.4 example that
* requires no other files.
import javax.swing.*;  
import java.awt.*;                //for Container class    
//  public class HelloWorldSwing {
   public class HelloWorldSwingToApplet extends JApplet {
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
//    private static void createAndShowGUI() {
      private void createAndShowGUI() {
        //Make sure we have nice window decorations.
//        JFrame.setDefaultLookAndFeelDecorated(true);
        //Create and set up the window.
//        JFrame frame = new JFrame("HelloWorldSwing");
//        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     Container frameApplet = getContentPane();
        //Add the ubiquitous "Hello World" label.
        JLabel label = new JLabel("Hello World");
//        frame.getContentPane().add(label);
     frameApplet.add(label);
        //Display the window.
//        frame.pack();
//        frame.setVisible(true);
      public void init() {
       createAndShowGUI();
/*    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
}

Similar Messages

  • Is it possible to run a java application within a web browser?

    Hello everyone here! I have a question about running a java application within a web browser and I would appreciate it very much if anyone here can give me some answers.
    I have a standalone java application written with AWT. Basically this free application lets users to select spectral lines from a big file based on some criteria and plot those selected lines. Yes, it is a very simple application. Now I want to run this application within a web browser so that users don't need to download the application from the ftp site and thus don't need to install in their machine. Is it possible to run this application within browser? If yes, can we get the same plotting function as we run the application separately and where should I start out?
    Thanks in advance!
    kuilian

    Please see the signed applet discussion group for details of how to avoid the applet security restrictions. You can sign the applet, or use the policy file containing {AllPermission} for testing purposes (though not suitable for widespread deployment).
    Regards
    Matthew

  • How to launch a Java application by clicking an icon for the windows system

    Hi Deal All,
    I am new in this forum, I am used to be at Cryptography. Currently I have completed a Java project and I am intending to launch it from Windows.
    I will design an icon but how I can launch the java application by clicking the icon in Windows system.
    Great thanks for your guidence!
    Best,
    Your friend.

    Hi Deal All,
    I am new in this forum, I am used to be at
    Cryptography. Currently I have completed a Java
    project and I am intending to launch it from Windows.
    I will design an icon but how I can launch the java
    application by clicking the icon in Windows system.
    Great thanks for your guidence!
    Best,
    Your friend.Make the icon a shortcut with a target of something like "javaw.exe YouClass.class"

  • How to open a java application from a web page?

    Friends
    I am in a situation to open a java application from a web page. I wrote a applet and placed a button on it. Onclicking of that button i con't open my java application. plz help me to open a userdefined application from web page.
    Ramesh
    e-Brahma technologies

    http://java.sun.com/products/javawebstart/index.jsp

  • How to launch a java application from Microsoft SQL Server

    Hi everyone
    I noticed the following line in a trigger will launch an executable.
    EXEC master..xp_cmdshell '"C:\Program Files\SkillSets.exe"', NO_OUTPUT
    Does anyone know if this same statement will launch a java program? Or does anyone have any positive experience with that ?

    yes...
    check this basic example:
    public class GoodWindowsExec{
    public static void main(String args[]){
    if (args.length < 1){
    System.out.println("USAGE: java GoodWindowsExec <cmd>");
    System.exit(1);
    try{           
    String osName = System.getProperty("os.name" );
    String[] cmd = new String[3];
    if( osName.equals( "Windows NT" ) ){
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    }else if( osName.equals( "Windows 95" ) ){
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    Runtime rt = Runtime.getRuntime();
    System.out.println("Execing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
    // any error message?
    StreamGobbler errorGobbler = new
    StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new
    StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    System.out.println("ExitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();

  • How to launch My Own Application by clicking a embedded link in iPhone

    Hi All
    Does anyone know how to launch my own application by clicking a embedded link in iPhone? same thing like you click a phone number , and then the phone application will be launched.
    Thanks
    -Tommy

    You have to place the URL types your application handles in the Info.plist - see LaunchMe's for the format.
    You'll do best opening it in a "plain text format" (right-click, open as), as it's a nested array instead of just a set of values, and it's easiest seen/modified in its native XML.

  • How to make a Java application that will change the client box's IP address

    HI how to make a Java application( that application would be run on the client ) that will change the client box's IP address ( IP address of itself )

    If you can do that through the command line, then use Runtime.getRuntime().exec(...) to execute your command.

  • How to schedule a java application via Windows Scheduler

    I can't figure out how to schedule a java application using the Windows Scheduler. Do I schedule the java application with the .class file as a parameter? How do I pass arguments to it?
    To execute FileCopy.class, my best guess was:
    Start | Control Panel | Performance and Maintenance | Scheduled
    Tasks | Add Scheduled Task | Browse | Program Files | Java |
    jre1.5.0_06 | ... Advanced Properties
    Under the Task tab:
    Run: "C:\Program Files\Java\jre1.5.0_06\bin\java.exe"
    Start In: "MyDocuments\Eclipse_Workspace\Java_File_Copy
    FileCopy"
    This does not work. How do I schedule the FileCopy.class java application, and how can I pass arguments to it? Can this be done without specifying a password?
    TIA,
    John

    Suppose that your class is FileCopy (has no package name) and is located under MyDocuments\Eclipse_Workspace\Java_File_Copy folder, then you should have:
    Run: "C:\Program Files\Java\jre1.5.0_06\bin\java.exe" FileCopy
    Start In: "MyDocuments\Eclipse_Workspace\Java_File_Copy"
    And yes you must provide a user password to execute the task.
    Best way to do this is to create a special user (with password) for executing this task.
    Regards

  • Launching a java application in another PC

    Hello everybody
    I want to know what to do if I want to launch a java application in a new PC which has anything installed in it.
    Thanks

    My problem is that if there is a new PC , nothing installed in it, can I launch a java application in it ?
    My friend asked me if I can build an application in java which I can use in any PC and the application will do something like an installation. In fact he wants to know if java can build an installation like application which will install for example a software on a new PC.
    I think I told you more clearly the situation.

  • How can i run java application at system startup just liks as services

    How we can run java application at the time of system
    starts up just like as services.

    Hi,
    At first you have to create an exe of the class file.
    for that go to the site www.duckware.com/java2exe.html
    Click on the j2exe23c.exe(75k) download it and install in ur system. convert the class file to windows exe.
    The put the exe in the startup folder in windows.
    If ur not able to find that folder search for it and put that exe in that folder.

  • Running a Java application from a web page?

    Hi
    Could anyone please tell me how do i launch a java application (which is not an applet) by clicking a button on a web page?
    Does the application have to be converted to .exe? And if so how do i do it?
    The application is on my PC not on a server.
    Thanking u in advance for ur help.

    Hi dins19
    Java WebStart is a pretty good technology for that purpose. Installing and launching a Java application on a local machine has always been a burdensome task. JWS really remedies that. The cool thing about JWS is that it works for both web and client applications. The technology introduces a new file format called jnlp which tells a program called "Java Web Start Application Manager" where the resources, typically a single jar file, are located. Check out
    http://java.sun.com/products/javawebstart/
    for a nifty demo.
    Hope this has been of some help.
    Morten Hjerl-Hansen

  • Automatic publishing a Java application in the web?

    Do you remember the nama of that tool which publish a Java application in the web, as is?

    :^))
    here it is...
    http://www.creamtec.com/webcream/index.html

  • How i can help to translate Mozilla FireFox (Web browser) in Uzbek language?

    How i can help to translate Mozilla FireFox (Web browser) in Uzbek language?

    Also [https://wiki.mozilla.org/L10n:Teams:uz]

  • How can i launch another java application using Runtime class?

    I created a java process which invokes another java application called Launch as shown below,
    Process p=Runtime.getRuntime().exec("java -classpath=C:\\Program Files\\bin\\nettools\\ui\\updates Launch");
    But it is not working...can any one help me on this?
    Edited by: deepakchandaran on Sep 20, 2007 7:10 AM

    You could search the forum and Google.
    it has been answered before.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • To launch a java application in Windows environment

    hello,
    I need to distribute one stand alone application, that I made using NetBeans, for sale it.
    I know that this is not a so simple problem, because delivering the program to one client you cannot simlpy say him to launch the jar file....
    I saw that, in the Windows environment, program like eclipse or netBeans run thruogth an .exe file, that I think is a program that its purpose is to define the java environment for the application in the particular host operative environment .
    Perhaps they are corporations like InstallShield (now Macrovision) that sale programs to solve this type of problems..., and I already used this type of programs to install some my
    applications that I coded in languages different than java.
    But before to look for one of them, I should like have more informations how this problem fits in java language, knowing that java is different to other languages because use JRE and have proper tools, how JWS and JNPL, that concern with this problem.
    ...Looking in the forum I had not much help..., but I saw that someone uses to write launchers program in different language, like C, as well I had not so much detailled instructions about how to do it.
    In order to solve my problem I should like have, from some one that already made it, some general information about how he realized the commercial installation of java applications in the most used Operatve Systems (particullary Windows), and possibly to have links to web sites for good explanations, including advantages to buy apposite commercials installation programs too.
    thank you very much
    tonyMrsangelo

    You can distribute it as an executable JAR so users will run it by double clicking. The would be required to have JRE installed.
    You can distribute it online via WebStart. Users need JRE but it's easier to manage updates and distribution of new versions.
    You can distribute it with AjaxSwing, a product that deploys Swing applications as AJAX websites so you don't need JRE at all.
    You can create EXE files using many of the products available. Google for it and you'll get lots of hits.

Maybe you are looking for

  • Could Not Find Installation Information for this Machine" I need Help!

    i accidentaly erased the main drive and now i am trying hard to reinstal the OS X again but i constantly keep seeing this "could not find installation information for this machine" i need help....

  • MacBook Pro startup glitch

    After disconnecting the HDMI cable to my MacBook Pro (Mid-2014 model) it started having startup glitches whenever I turn it on. Grey and white stripes appears at the bottom of my screen, I think they're Apple logos? A smaller display appears with the

  • ACE SSL Terminator doesn't work

    Hi, I should implement a balancing HTTP and for HTTPS an  SSL terminator on my ACE. Public IP 22.235.121.6 port 80 --> balanced on 192.168.250.165-166 on port 8889 Public IP 22.235.121.6 port 443 --> my ace terminate ssl and balance the traffic in cl

  • How to create DBA user?

    How to create user like "System" with all the right of DBA??

  • Help -- vectors

    i am writing an editor and i have run into a problem. I am using vectors to keep track of the documents that opened. the documents are displayed in a JTabbedPane and i am using a JTextArea for editing them. When i try to do go to Select All of i get