tags:

views:

661

answers:

3

I was wondering if I could pop up JOptionPanes or other Swing components from within a browser using JSP.

+4  A: 

If you embed an applet. But I don't think that's what you want. Swing is for desktop apps. JSP web pages. If you want components, try looking into JSF or some of the many AJAX Javascript frameworks like prototype.

sblundy
+1  A: 

You may also want to consider GWT, which enables you to develop a web interface in Java code (the Java code is converted to HTML & JavaScript by the GWT compiler). Although you don't program to the Swing API directly when writing GWT applications, the GWT API is very similar in style to Swing programming.

Don
A: 

Assuming you're familiar with Swing, you may want to introduce yourself to Apache Wicket which is very similar to the way you build web pages as Swing is to building GUI:s. That is, in Wicket you add new instancef of Label, Button, DataTable etc. etc. to page and link those to bean property data which is then ultimately transformed to fully functioning web page.

As for the actual question, you really can't do it as-is. If choosing a new/different/another web framework to help you isn't possible, the only proper way I can think of is doing what sblundy suggested.

P Arrayah