Results 1 to 2 of 2
- 06-13-2012, 07:26 AM #1
Member
- Join Date
- Jun 2012
- Posts
- 1
- Rep Power
- 0
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?
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.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) {} } }
Cheers,
Grifman
-
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
-
for web application developed in struts
By manohar.kavala in forum StrutsReplies: 0Last Post: 03-28-2012, 09:38 AM -
hi,i developed an application using swings which displays a jTabbedPane.It is workin
By REBEL in forum New To JavaReplies: 3Last Post: 03-21-2012, 02:06 PM -
I'm new to Java, help on where to start on making my own application?
By Zexanima in forum New To JavaReplies: 2Last Post: 10-01-2011, 02:08 AM -
Making a program out of a Java Applet
By Bomber_Will in forum Java AppletsReplies: 1Last Post: 07-16-2009, 02:54 AM -
Making Java Application Executable
By jadaleus in forum Advanced JavaReplies: 4Last Post: 10-23-2008, 12:59 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks