Swing used in WebBrowser

How can i use GUI in web browser. Is there any possibilities for swing to run on browser for graphical use.

 Not in applet,its swing, give me some idea and sample coding.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


As far as I know, without applet, unfortunately you can't do that. YOu need to have applet to display SWING on webbrowser. Otherwise, you need to use JSP or HTML to display it.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
>> Not in applet,its swing

You can use Swing in a JApplet, but suprapto45 is right, you need an applet of some sort...

there is a way of doing it without using applets -- but i wouldn't recommend it:
you can use a java servlet engine and start the swing components (say a JFrame) on the server side and use an image encoder to take a snapshot of the components and then push that as an image to the user. The using some server-side image maps you process user input when s/he clicks on the image, detect coordinates, find out what control s/he has clicked on and invoke the actionlistener on the server side for that control. Like I said, it can be done, but I would argue that one would be well.... mad for no better word :) to try to do it this way.
Ooooh...  Good call...I remmeber there was a framework that did that for you, but it never really worked right...

*tries to remember its name*

Webcream I think:


Well, like I said Tim, I would have never thought of a need to actually do this. Besides, Swing is "heavy" and to have a server with say 1000 connections, each one starting up 3-4 JFrames with JPanels and the whole lot inside would be a killer for any Rolls-Royce server I reckon. Still, it is a way of doing things.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.