Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9037105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:09:58+00:00 2026-06-16T09:09:58+00:00

I have a small (Swing) JApplet that runs perfectly in Eclipse: it contains a

  • 0

I have a small (Swing) JApplet that runs perfectly in Eclipse: it contains a label, two buttons and a menu, with minimum user interaction (when choosing a menu item, the color of the container changes).
I converted this to a .jar:

  • I right clicked the class name (Sw3.java)
  • Selected “Export”, then “Java”, then “JAR file”
  • Next, I chose current project name as resource to export, doubled clicked the “Default package” underneath it, selected desired class name from the list of classes in the right (Sw3.java)
  • Next, I ticked “Export generated class files and resources”, selected the export destination as “JAR file” and placed it in “Documents” under the name “Sw3.jar”. I also selected “Compress the contents of the JAR file”.
  • In the next screen I checked “Export class file with compile errors” and “Export class file with compile warnings”

I heard the right way to obtain an exe file is to convert a .jar into .exe so I used the “Launch4j” application with the .jar obtained previously:

  • In the “Basic” panel: specified OUTPUT FILE: C:\Users\jerry\Documents\Sw3.exe and the JAR file: C:\Users\jerry\Documents\Sw3.jar.
  • Process priority NORMAL
  • Header type: GUI
  • MIN JRE Version: 1.0.0
  • I pressed the “wheel” and chose Project.xml and got a succesful confirmation message.

I have JRE installed, so the .exe should work, but it doesn’t work. What did I do wrong? I would start by investigating if the .JAR was correctly obtained, is that a good approach and how would I check that? Thank you!

PS: Upon being advised to use JFrame instead of JApplet, I did that and still nothing happens when I double click the .exe in order to open it. This makes me suspect there is something wrong in the steps I described.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:09:59+00:00Added an answer on June 16, 2026 at 9:09 am

    Add a main method to your applet to put it inside a JFrame:

    public static void main(String[] arg) {
      JFrame frame = new JFrame();
      JApplet applet = new Sw3();
      frame.getContentPane().add(applet);
      frame.pack();
      frame.setVisible(true);
      applet.init();
      applet.start();
    }
    

    In the Eclipse JAR exportation dialog, after the “JAR Packaging Options” screen (the one with “Export class files with error and/or warnings” that you mention above), click next (and not finish). Choose “Generate manifest file” and enter the fully qualified (i.e. including package) class name of your main class:

    Generate manifest with Main-class attribute from Eclipse JAR export

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small bit of code that runs in an applet that contains
I have a small Java Swing application that I want to rewrite in WPF
I have a small Java desktop app that uses Swing. There is a data
I have a small workspace with 3 projects. One main (Swing) application, two other
I have made a small java swing application that I want to share with
I have a small (500kb) swing applet that displays very simple/limited set of small
I have written a small program, while reading a book about swing, that creates
I have small web app that generate PDF files as a report. I'm trying
I have an interface that has multiple small JTables stacked on top of each
I have made a small number guessing game in Java. My main JFrame(main menu)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.