Results 1 to 2 of 2
  1. #1
    Grifman121 is offline Member
    Join Date
    Jun 2012
    Posts
    1
    Rep Power
    0

    Default Making an already developed java application into an applet.

    Hi i've been working around with java for a little while now and I know how to create a textbased game in java. My problem is that I want to put this onto a web page when i'm done but i have no idea on how to take this into an applet. Can anyone help me out?

    Java Code:
    import java.util.* ;
    
    public class aa {
    	
    	public static String name; //Player's Name
    	public static Scanner s = new Scanner(System.in); //Scanner
    	
    	public static void main(String args[]) {
    		
    		
    		System.out.print("Please input your name: ");
    		name = s.nextLine();
    		System.out.println("Welcome " + name);
    		sleep() ;
    		System.out.println("Year 2091");
    		sleep() ;
    		System.out.println("Zeus, Travelling Dreadnought");
    		sleep() ;
    		
    		//Loading Effect
    		System.out.print(".");
    		qsleep() ;
    		System.out.print(".");
    		qsleep() ;
    		System.out.print(".");
    		qsleep() ;
    		//Loading Effect
    				System.out.print(".");
    				qsleep() ;
    				System.out.print(".");
    				qsleep() ;
    				System.out.print(".");
    				qsleep() ;
    				//Loading Effect
    				System.out.print(".");
    				qsleep() ;
    				System.out.print(".");
    				qsleep() ;
    				System.out.println(".");
    				qsleep() ;
    		//End Loading
    			
    		System.out.println("In 2054 the human race made it's greatest discovery \nSelf Sufficient Artificial Intelligence");
    		System.out.println("Humans around the world cherished in their own glory \nUnaware of the monster they created they ignored " +
    				"people who said they had brought hell to earth...");
    		System.out.println("In the year 2087 the AI had become fully aware of it's power and \nnamed itself Kronos");
    		
    		//Loading Effect
    		System.out.print(".");
    		qsleep() ;
    		System.out.print(".");
    		qsleep() ;
    		System.out.println(".");
    		qsleep() ;
    		
    		sleep() ;
    		System.out.println("Fast Foward to 2091... Kronos raised an army of slef sufficient robots and \noverpowered it's human masters.");
    		
    	}
    	
    	//Sleep Method
    	public static void sleep() {
    	
    		try {
    			
    		Thread.sleep(1000);
    		
    		} catch (Exception exc) {}
    	
    	}
    	
    	
    	//Long Sleep Method
    	public static void lsleep() {
    		
    		try{
    			Thread.sleep(5000);
    			
    		
    		} catch (Exception excx) {}
    		
    	}
    	
    	//Quick Sleep Method
    	public static void qsleep() {
    		
    		try{
    			Thread.sleep(500);
    		} catch (Exception excq) {}
    	}
    		
    }
    Please ignore the story for now because this is a rough draft. I just wanna know if it's not to late to turn this into a java applet for the web.

    Cheers,
    Grifman

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Making an already developed java application into an applet.

    Your code above is nothing but a static main method with one utility method, and it appears that you're far from simply putting it into a GUI. If you want to create a GUI, first I would create an OOP version of this with true classes that have state and behavior, and then I'd recommend studying the Swing tutorials to learn how to code a Swing GUI. There are a number of steps that will need to be taken, but if you start out on the path, you won't be disappointed.

Similar Threads

  1. for web application developed in struts
    By manohar.kavala in forum Struts
    Replies: 0
    Last Post: 03-28-2012, 09:38 AM
  2. Replies: 3
    Last Post: 03-21-2012, 02:06 PM
  3. Replies: 2
    Last Post: 10-01-2011, 02:08 AM
  4. Making a program out of a Java Applet
    By Bomber_Will in forum Java Applets
    Replies: 1
    Last Post: 07-16-2009, 02:54 AM
  5. Making Java Application Executable
    By jadaleus in forum Advanced Java
    Replies: 4
    Last Post: 10-23-2008, 12:59 PM

Tags for this Thread

Posting Permissions

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