Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    9
    Rep Power
    0

    Default Run Applet From GUI?

    I want to make a GUI in which the user selects their name and difficulty level, and then runs a game which is an applet. Is there a way to do this?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    Very little is impossible, but why on earth would you want to do this?

    db

  3. #3
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Stick the contents of the applet in a Frame instead.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    I think it's a clunky approach to a non-problem.

    In the worst case, which is if the applet is contained in a third-party jar, one could construct an instance of the Applet, invoke its init() method and add it to a Frame (or for a JApplet, set its contentPane to be the contentPane of a JFrame).

    If the source is available, it should be trivial to refactor the game to be housed in a JPanel which can then be set as the contentPane for either a JApplet or a JFrame, which gives the maximum flexibility and is the preferred development route for any game or other GUI which may be required to be run either as a local application or in a browser window, as an applet.

    db

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Okay db, I agreed with your comment. As you said it could be a real mess working on with third part jar files and stuff.

  7. #7
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Quote Originally Posted by Eranga View Post
    Can't we execute a html from the UI? db and OD, what you guys think of that?
    For the same reason we don't execute html in order to display an image, or some text. It's a horribly over-complicated hack.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. applet to jsp
    By abinesh.s in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-27-2009, 07:33 AM
  2. Calling another applet on click of button in one applet
    By niteshwar.bhardwaj in forum Java 2D
    Replies: 1
    Last Post: 02-19-2009, 12:54 PM
  3. Need with an applet
    By maggie_2 in forum Java Applets
    Replies: 6
    Last Post: 09-21-2008, 08:07 PM
  4. First Applet HELP????
    By nvidia in forum New To Java
    Replies: 0
    Last Post: 08-13-2007, 10:11 PM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 AM

Posting Permissions

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