Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java applet.

Status
Not open for further replies.

mgl70

Programmer
Joined
Sep 10, 2003
Messages
105
Location
US
Hi,
I want to access the java swing application from browser. I know if it is an applet, we can call the java class from html page. So for this, do I need to change my swing application to applet. or any different way.
thanks,
 
You may modify your project in this way:

Your app-main - class should do as few as possible, and be there only for starting the app.

The applet-class should do it in a similar way, but of course applets are threated specially in their startup-routine.

So you can produce two different starting-points for your program - one for an app, one for an applet.

seeking a job as java-programmer in Berlin:
 
That means should I change my app-main-class to applet.I am sorry. I did not understand properly.
thanks,
 
No, you have 2 (in words: two) main-classes.
One for starting as applet, one for starting as app (probably using/ etxending JFrame).

Code:
console                                 browser
   |                                    |
   V                                    V
-------          ---------------        ----------
| app | -------> |    content  | <-----| applet |
-------          ---------------        ----------
                        |
                        V
                -----------------
                | other stuff   |  
                -----------------

seeking a job as java-programmer in Berlin:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top