Results 1 to 11 of 11
Like Tree2Likes
  • 2 Post By KevinWorkman

Thread: Do you need JFrame for making an executable JAR?

  1. #1
    Join Date
    May 2011
    Location
    Seattle, WA
    Posts
    35
    Rep Power
    0

    Default Do you need JFrame for making an executable JAR?

    Do you need to use JFrame when making an executable JAR file, instead of Applet?
    Because if that is the case I might need to re-code a lot of things...

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

    Default Re: Do you need JFrame for making an executable JAR?

    This question confuses me. No, you don't need a JFrame to have a functioning Jar file, but what induced you to think that this was so? Can you please explain what is causing you to ask this question. The details of your problem may be important.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,863
    Rep Power
    19

    Default Re: Do you need JFrame for making an executable JAR?

    I think the OP has an Applet (in a jar) and wants to know if that would need to be a JFrame instead in order to run on a desktop (ie executable jar).

  4. #4
    Join Date
    May 2011
    Location
    Seattle, WA
    Posts
    35
    Rep Power
    0

    Default Re: Do you need JFrame for making an executable JAR?

    Quote Originally Posted by Tolls View Post
    I think the OP has an Applet (in a jar) and wants to know if that would need to be a JFrame instead in order to run on a desktop (ie executable jar).
    That is correct, because it appears that Eclipse will only let me make executable Jar files if I'm extending to JFrame.

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,889
    Rep Power
    8

    Default Re: Do you need JFrame for making an executable JAR?

    Quote Originally Posted by meesterpickles View Post
    That is correct, because it appears that Eclipse will only let me make executable Jar files if I'm extending to JFrame.
    Put your program in a JPanel. Then you can add that JPanel to either a JFrame or a JApplet. I see no reason to extend JFrame at all.
    Tolls and Fubarable like this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,863
    Rep Power
    19

    Default Re: Do you need JFrame for making an executable JAR?

    No.
    Eclipse will only let you make an executable jar if your code has a main() method somewhere as an entry point, which an Applet doesn't.

    However, you will need to use a JFrame as Applets need a browser (or container of some sort) to launch.

  7. #7
    Join Date
    May 2011
    Location
    Seattle, WA
    Posts
    35
    Rep Power
    0

    Default Re: Do you need JFrame for making an executable JAR?

    Okay so I think I get it now, thanks everyone.

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,386
    Blog Entries
    7
    Rep Power
    20

    Default Re: Do you need JFrame for making an executable JAR?

    Quote Originally Posted by Tolls View Post
    No.
    Eclipse will only let you make an executable jar if your code has a main() method somewhere as an entry point, which an Applet doesn't.
    Eclipse doesn't care less what you put in a .jar file; it's only one of its wizards that forces you to do so. There's another wizard: Export ...>Jar File that accepts every file, package or project as content for a .jar file.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,863
    Rep Power
    19

    Default Re: Do you need JFrame for making an executable JAR?

    Quote Originally Posted by JosAH View Post
    Eclipse doesn't care less what you put in a .jar file; it's only one of its wizards that forces you to do so. There's another wizard: Export ...>Jar File that accepts every file, package or project as content for a .jar file.

    kind regards,

    Jos
    I did say "executable"...:p
    By its very nature you can't have an executable jar without a main() method defined somewhere, and pointed to by the manifest.
    Well, you could but it would complain rather a lot.

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,386
    Blog Entries
    7
    Rep Power
    20

    Default Re: Do you need JFrame for making an executable JAR?

    Quote Originally Posted by Tolls View Post
    I did say "executable"...:p
    By its very nature you can't have an executable jar without a main() method defined somewhere, and pointed to by the manifest.
    Well, you could but it would complain rather a lot.
    Well, duh ... I never use that wizard to create executable .jars; I use the wizard for real men (like me) who know exactly what to put in a .jar file (unlike all those sissies who need that other sissie wizard ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,863
    Rep Power
    19

    Default Re: Do you need JFrame for making an executable JAR?

    I just use whatever ant script the client has already written...:)

Similar Threads

  1. JFrame making it do an action on exit
    By kris5228 in forum AWT / Swing
    Replies: 2
    Last Post: 11-26-2011, 08:29 PM
  2. create windows executable using executable jar file
    By sarwar1234 in forum New To Java
    Replies: 2
    Last Post: 02-07-2011, 08:29 PM
  3. Making a netbeans project into a executable jar file
    By counterfox in forum New To Java
    Replies: 3
    Last Post: 12-03-2010, 05:09 PM
  4. Making a JApplet into a JFrame into a .jar
    By aqualicy in forum Java Applets
    Replies: 2
    Last Post: 05-14-2010, 04:29 AM
  5. Making Java Application Executable
    By jadaleus in forum Advanced Java
    Replies: 4
    Last Post: 10-23-2008, 12:59 PM

Posting Permissions

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