Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to convert Applet program into an Exe

 
vijayendra sandeep vulligundam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi All,

I have created a Application in JApplet using swings.When i need to open the application i need to go to CMD and complie the program.I want to convert this application to an exe ,so that i can double click that and make the application to work.
Could you please help me how to convert Applet Program into an Exe?


Thanks

Sandeep
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it need to be an .exe file? That implies compilation to native code which introduces a number of complications. Would having a double-clickable jar file be sufficient?

It's not hard to keep code that is usable both as an application and an applet if you have a clear separation of the applet-specific stuff and the general GUI stuff. Basically, the application's main class would open a JFrame, and then add the GUI, just like the applet would do with the applet's main panel. If you have anything in the applet's init, start and stop methods, you may need to refactor that into separate methods that are usable both from the applet code and the application code.
 
vijayendra sandeep vulligundam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the reply.

I have used Init() method.i have used around 16 tabs which acts as different classes for each tab.now i need to convert this who;e application into an exe.I am not aware how to do this?And am new to java..but i have managed to create tabs using swings.

Please help me how to make this into an exe.
I have used jpanel,japplet. and jtabbedpane. i have not used jframes.
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically a JApplet is just a Container, so you should be able to add it to a JFrame's content pane. You must remember though to call methods like init() manually; the browser / applet viewer isn't around to do it for you.

As a hint for the future: follow Ulf's advice. Put all your actual code inside a subclass of JPanel, then the only thing the (J)Applet has to do is add an instance of that class. If you change to JFrame, the same rules apply: just add an instance to the JFrame.

The only thing that may be problematic is the JMenuBar since that cannot be added to JPanels in the same way as to JFrames and JApplets. However, you can have the panel create the JMenuBar and return a reference to it.
 
Lovelesh Sharma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am also having similar kind of problem, I have made an aplication in applet by using jframe & made a subclass clicklistner in which i am using jfilechooser dialog. Now i want to make an exe of this application, kindly help me out in this,
Thanks in advance, i need it very urgently as it is one of the clients requirement.
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/java/EaseUp
http://faq.javaranch.com/java/DontWakeTheZombies - a new thread would have been better
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic