0

I was wondering if A Java applet can also use Java web start, I have been doing this in a project ive been working on an am worried that this may have caused some issues...

Matthew Pigram
  • 1,400
  • 3
  • 25
  • 65
  • 3
    Modern Applets *use* the JWS "Applet" container (since like Java 6u18). However, the "starting object" needs to be different. If this bit is extracted out then there should be no issue calling your main code in both an Applet and JWS context. –  Jul 09 '12 at 03:09
  • 2
    This [hybrid](http://stackoverflow.com/a/11372932/230513) is an example. – trashgod Jul 09 '12 at 03:14
  • so does this mean I will need a main() function call in my code? – Matthew Pigram Jul 09 '12 at 03:24
  • @MatthewPigram For JWS .. yes. –  Jul 09 '12 at 03:32
  • 2
    *"does this mean I will need a main() function call in my code?"* Applet by JWS -> ***No!*** I believe you might have been thrown off by @trashgod mention of 'hybrid'. An 'hybrid is **both** a `JApplet` and a `JFrame`. It can be launched as either, and uses the `main(String[])` to launch the frame. – Andrew Thompson Jul 09 '12 at 23:44
  • 1
    @AndrewThompson is correct. I believe that the hybrid approach offers more flexibility, easier debugging and a measure of clarity, but it is not _required_. – trashgod Jul 10 '12 at 01:27
  • @trashgod *"the hybrid approach offers.."* +1 to your reasons. Both of us have made good use of hybrids. My main reason is 'flexibility', since I'll typically offer the hybrid app. both ways. – Andrew Thompson Jul 10 '12 at 01:34
  • so in other words, to create a hybrid from my applet, I add the main function and place run() within it, this will allow me to both use the program as and Applet and/or as a JWS application as well depending on how I decided to use it? – Matthew Pigram Jul 10 '12 at 02:33
  • oh an create a frame in the main call – Matthew Pigram Jul 10 '12 at 02:35

1 Answers1

0

A hybrid approach offers more flexibility, easier debugging and a measure of clarity, but it is not required. But yes Applets can also be used as Java Web Start applications.

(answered by Andrew Thompson and trashgod)

Matthew Pigram
  • 1,400
  • 3
  • 25
  • 65