I know Swing provides good GUI capability. Now, with web applications we use JSP or Servlets(again like JSP). How do we use swing here when we going to run web application using http. Most examples in books i have seen are using applet or stand alone application. That is not a normal case. What kind of set up we need in architecture to use swing.
You can't use Swing in a standard web app. Embedding applets are the only way to get Swing in a web browser. You can distribute stand-alone apps over the web with jnlp.
The end result of a web application is an HTML page displayed in a browser. Java is one way to provide dynamic content in the form of generated HTML documents delivered through a servlet container (like Tomcat).
You may want to look at some web frameworks such as Tapestry (My personal favorite), Spring MVC, Struts, JSF (not sure if JSF really qualifies as a framework though).
Although I would reject the idea that a stand-alone Java app is not the 'normal case'.
Hi Steven, So what would you suggest best for making colorful webpages.So,should we use just JSP,Servlets,HTML,Applets and Java Script.Would that serve the purpose??Can we make a full-functional website without using swing.I am thinking to make a website,but i am not quite sure where to start with.I need the drop-down boxes,dynamic images,login etc functionalities.Can i avoid swing and get all these funtionalities into my website.Please tell me the simplest way..thanks.
Just to be clear: no websites use Swing. Swing-based applets on the Web are exceedingly rare, and those few that exist are tech demos or toys of some kind. No websites use applets as their primary mode of interaction.
Swing is for desktop apps; JSP (i.e., HTML) is for web apps.
Thanks Ernest, But just a small element of doubt still exists......if for instance,I use JSP to generate web-pages,I won't have lay-out manager sort of functionalities,so dont you think that it would be a little difficult to handle with simple HTML tables.And where from would we get the drop-down menus,checkboxes....do you think html should be used to generate all of them in combination with java script. Thanks
author and iconoclast
You'd be surprised what you can do with HTML (for expressing the content) and CSS (for doing the formatting and layout.) Remember that every web site you visit is working with these same basic tools.
Joined: Apr 24, 2003
Originally posted by Ernest Friedman-Hill: No websites use applets as their primary mode of interaction.
Are you sure about that? I support a web site built around applets. Also, I am fairly certain that at least one on-line brokerage uses Swing to enable all sorts of functionality to traders. In fact, my brother in laws firm writes support applications for traders and brokers using Swing over the web. So, swing and applets may be rare but I wouldn't say that there are no websites using them.
No, not like that. I am talking of two controls. Navigator conrol - it has like file explorer and tab pages(there could be nested tab pages). These can not be implemented using JSP/HTML etc, I believe tab page can be done with swing. But doing w/o applet constraints design. Applets are not allowed because of security concerns at most classified govt projects.
Originally posted by Raj Puri: I know Swing provides good GUI capability. Now, with web applications we use JSP or Servlets(again like JSP). How do we use swing here when we going to run web application using http.
If you wrote a good API to handle all the business logic, which was generic enough to "port" over to any context, then moving it from say, a web application to a command-line interface or GUI should not be a problem. If you find that you need to change a lot of code (not the presentation-layer), then its probably a bad design.
Are you trying to port a web application to a GUI or vice-versa? HTTP browsers are very basic, they are HTML viewers with some addon's. If you want more control over what the user sees, with rich widgets, than using a GUI library such as Swing or SWT/JFace would be the way to go. If you use the MVC pattern, then changing the "View" should not be a problem at all.
Originally posted by Raj Puri: Applets are not allowed because of security concerns at most classified govt projects.
If you sign the applet, you can bypass the security and the applet can do I/O on the local machine. I don't know what you mean by "classified govt projects". [ May 14, 2005: Message edited by: Kashif Riaz ]
author and iconoclast
Originally posted by Thomas Paul: So, swing and applets may be rare but I wouldn't say that there are no websites using them.
I stand corrected, I guess. Maybe I should qualify what I said to "no general-purpose consumer Internet sites." Intranets use them, certainly, as would sites that deliver rich functionality to motivated customers. But what I was saying in general was that any consumer website that wants to capture Joe Sixpack's attention commits customer-service suicide by requiring the Java plug-in.
Joined: Dec 29, 2004
Originally posted by Raj Puri: No, not like that. I am talking of two controls. Navigator conrol - it has like file explorer and tab pages(there could be nested tab pages). These can not be implemented using JSP/HTML etc,
I believe tab page can be done with swing. But doing w/o applet constraints design. Applets are not allowed because of security concerns at most classified govt projects.