0

I Have Create a One Swing Application and I Want To Run My Swing Application In To My Local Web Browser So Plz Tell Me How Can I Do This Because For Applet Program There Is No Any Longer Process For This.

1 Answer 1

1

Browsers do not know to run applications. They run applets.

There are 2 ways to refactor you application.

  1. if you wish the application to run in its own window, just write applet that calls YourApplication.main() from its method start()

  2. If you wish to see your application into the browser's window (as a part of your web page) you have to create applet (that extends Pannel), set its layout to BorderLayout and then put the main panel of your application into center of applet. That's it.

If you do not have one panel that contains all elements, e.g. you are adding all elements directly to JFrame you have to fix your application. Create one main panel, add all elements there and put this panel to the center of your JFrame.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.