If you are using Netbeans IDE, then creating .exe file from .class file won't take much time. In IDE, create a new project and put your java program in this project. Now follow these steps-
- Right click the project and choose properties.
- Choose run from left panel and enter the main class(in which main method is defined) in right panel.
- Again right click the project and choose add library. Select swing layout extensions. Click add library.
4.Now select clean and build from run menu in your IDE. Make sure that you have already set your this project as main project.
- Open the CMD and set the directory to your project. Go to "dist" > and type java -jar jarname.jar.
- Your program is running in cmd now.
- Open launch4j and provide the information required.
- Run and enjoy your application.