SuperDisk
SuperDisk

Reputation: 2840

Java: Convert an applet to a desktop application

So far I've only seen ways to convert Java desktop applications to applets. Is there any way to do the reverse? (it inherits from java.applet.Applet)

Edit: What I meant was to somehow make an applet a desktop executable JAR file (swing or something).

Upvotes: 1

Views: 4862

Answers (2)

MadProgrammer
MadProgrammer

Reputation: 347184

Without any (example) code it's difficult to pin point an example.

However, the general approach is to contain all your application logic and GUI code in a separate package/classes. By containing your basic UI in something like a JPanel, you can chose where to place it.

This not only means you can switch it out into a JApplet or JFrame, but also include it as part of a compound UI as required

This is one of the reason why we suggest not adding/building your UI directly on top of a top level container

Upvotes: 1

Patuck
Patuck

Reputation: 171

The easiest way would be to run it in some sort of AppletViewer

http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/appletviewer.html

Here is a similar question.

https://softwareengineering.stackexchange.com/questions/188982/how-to-run-an-applet-like-a-desktop-application-without-installing-entire-jdk

Hope it helps.

Failing which you will need to re-base the code on JFrame and java Swing

Upvotes: 1

Related Questions