Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

application to applet conversion  RSS feed

 
khyamanidhi sahoo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Could anybody please extend helping hand how I can convert a Swing program to an Applet. I have developed a Java application using Swing and now I want to implement it in Web. So should I write the same program using applet or is there any method by which I can convert it to an Applet so that I can call the applet through applet tag from html code.
regards,
Khyama
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First there is an appletforum. (and a swingforum too).
Second: due to appletrestrictions (box of concrete) you may ran into problems.
If there are no such restrictions, you may look at simple applet requierements - they don't have a main-method but some other kind of init. And you need a little html-page.
I would refactor the Class containing main, extracting everything which is needed for an applet too, and try to only create a JFrame in this.
Then create an applet-class, which starts in an appletway.
Both could be able to create the rest of the application.
So you would end with a programm with two entrypoints.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmmm I think I'll move this to the Applet forum seeing as though your main question is how to convert an application to an applet.
I'd do a quick search on java.sun.com -- I'm sure they have tutorials there that cover this topic.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!