Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28
  1. #21
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    3

    Default

    The applet is starting up, but the problem is that this is the first time I'm doing this, if I do it myself I will have to re-write the entire code (I am "NOT" gonna get this to work myself). My problem is that I am alone in the dev-team for this game (That means no help) that is why I'm trying to get someone to do it for me the first time (That makes me to learn). When someone helps me, I learn. (I look at the code & I see how to do it also learn how I should do the next time.

    Alex

  2. #22
    kammce's Avatar
    kammce is offline Senior Member
    Join Date
    Dec 2010
    Location
    California
    Posts
    194
    Rep Power
    4

    Default

    Well first, you are not changing the entire code. Second, I am a one man game design/programmer myself.
    But your program is up and running as an Applet right? You said that the applet is starting up, so that makes me think that you had gotten it to work.

  3. #23
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    3

    Default

    The applet runs, but I give up. Can't get it to work. I would need someone to help me the first time. Then I'll go through the code. And I will learn. Please that's the best soulution.

    Thanks,
    Alex

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

    Default

    Quote Originally Posted by Alerhau View Post
    The applet runs, but I give up.
    If a little frustration will make you give up, then you may not be cut out for programming and might as well quit your course. I believe you can do more and succeed if you keep trying. You've nothing to lose.

    Can't get it to work. I would need someone to help me the first time. Then I'll go through the code. And I will learn. Please that's the best soulution.\
    You've been told before that it doesn't work that way here. Please don't keep begging for code else we'll have to lock this thread or worse.

  5. #25
    kammce's Avatar
    kammce is offline Senior Member
    Join Date
    Dec 2010
    Location
    California
    Posts
    194
    Rep Power
    4

    Default

    If the applet does not work, then it does not run. If you can put a game together, then surely you can figure out how to change your Java Application (that extends JFrame) to a Java Applet (that extends JApplet). The whole point of programming is to be able to figure out a problem and solve it. Your problem is a conversion from a Java Application to an Applet. DarrlyBerke gave you the steps to that conversion.

  6. #26
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default

    You have a copyright game that you consider someone (not kammce, of course!) could find attractive enough to want to steal, and you can't follow the steps given, with the help of the tutorials linked, to convert an application to an applet? Tell me another

    db

  7. #27
    Alerhau's Avatar
    Alerhau is offline Senior Member
    Join Date
    Jun 2011
    Location
    Sweden
    Posts
    158
    Rep Power
    3

    Default

    I'll give it one more try, but first I have some questions.

    1. I have a glass pane on my window, what do I do with it? Does it work on an applet?
    2. My game is not extending the JFrame, I have created the JFrame separate in the code.
    3. How do I set the layout on a JApplet, I'm a little confused.
    4. I have a lot of methods in my game, not many classes. How do I do to keep methods, just keep 'em? Does it really work with "public void METHODNAME" in a JApplet?

    Alex

  8. #28
    kammce's Avatar
    kammce is offline Senior Member
    Join Date
    Dec 2010
    Location
    California
    Posts
    194
    Rep Power
    4

    Default

    1) I believe your glass pane should work in both Applets and Applications because they are both apart of Java.Swing
    2) From my experience, you will need to extend to JApplet and include the public void init(). Just add all of your components into the init() function. Use
    Java Code:
    Container content = getContentPane();
    and add everything to that container. If you have another JFrame that will appear in your applet, let it be. What will happen when you make it visible or initiate it, it will pop up. The starting JApplet is the only thing that needs to have extends JApplet and the init() function.
    3) Again! Use
    Java Code:
    Container content = getContentPane();
    and then use
    Java Code:
    lowLayout flow = new FlowLayout();
    (if you want to use flow layout) and add to it as you please. JApplet and JFrame are nearly the same thing. They just have some different rules but everything that has to do with Java.awt and Java.swing work in JApplets.
    4) yeah, just keep 'em. They will still work. Java did not change, just how you deploy it.

    I hope this helps!

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Problem of conversion JFrame to Applet
    By Rekuta in forum Java Applets
    Replies: 9
    Last Post: 05-16-2010, 03:31 AM
  2. Jframe pass variable to Applet
    By wayn in forum AWT / Swing
    Replies: 0
    Last Post: 03-10-2010, 09:54 AM
  3. Embed java applet in JFrame
    By Bill89 in forum New To Java
    Replies: 0
    Last Post: 12-09-2009, 01:05 PM
  4. Closing Popup JFrame in Applet
    By Arsenic in forum Java Applets
    Replies: 3
    Last Post: 04-10-2009, 08:37 PM
  5. JFrame vs Applet
    By baltimore in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 03:24 AM

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
  •