|
Sponsored Links
Resources
Enterprise Java Research Library
Get Java white papers, product information, case studies and webcasts
|
News
News
News
|
Messages: 38
Messages: 38
Messages: 38
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
Java.net article: Bringing Swing to the Web
In "Bringing Swing to the Web," author Jacobus Steenkamp discusses how one can take Swing components and render them almost purely from a Servlet, such that a developer can use Swing, quite literally, to create a web user interface. While this is far from perfect in implementation, it brings up some interesting concepts - some already brought up by other frameworks.
For example, he points out that JSF's PhaseListener can be used to render the images - while focusing on simple servlets in the interest of brevity (and for a shorter learning curve.)
The approach being used here for building a UI is similar to the approach advocated by Wicket and some other web frameworks, with the main difference being that instead of copying the model from Swing (or other GUI component models), it's using Swing itself, which might lead to a developer who's able to use Swing being able to render directly to a web interface.
However, as the author points out, there are some difficulties - for example:So far, all of the images that we have drawn have been static. The next logical step is to make these images dynamically update themselves and appear to be "animated" from an end user's point of view.
Although this is not achievable using pure HTML, it is possible to implement it using a small amount of JavaScript. The JavaScript will basically instruct the browser to continually poll the server for the latest version of the image. To ensure that the browser does not cache the image, a unique URL parameter is passed to the server on each request... It raises some interesting possibilities. Bringing JSF into the mix highlights a sort of "Holy Grail" of GUI development - if someone could manage to get Swing actually rendered well on the browser, without relying on an applet or another plugin, the possibilities might be endless.
What do you think?
|
|
Message #206738
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
swing + AJAX
Interesting, If the power of swing can be combined with the concept of AJAX , it would be a great improment to Web 2.0.
It is pain to use javascript to create interface. If it is possible to limit the javascript on the calls of xmlhttprequest, it would simplify the programming.
|
|
Message #206750
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Not new..
Echo2.
and Millstone (soon to have AJAX).
And, while not AJAX enabled - WebOnSwing and WebCream.
They've all been around for a few years.
|
|
Message #206777
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Big whoop. Was done years ago.
http://www.creamtec.com/webcream/take a swing app and deploy it to a browser (no plugin). The Swing components are rendered into HTML markup.Not perfect but pretty darn good. Sounds good. The factor: costs of a third-part solution on the presentation-level(only...), is in commercial applications a important criterion, too.
Especially when are installations on various hosts indispensable.
-roland
|
|
Message #206778
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Is Swing really the good programmatic model
Mostly for the web... Swing has rather failed in the RDA (Rich Desktop Application) kink of application. RCPs try to enhance the model. Web can be considered has more productive but resulting code lake of main maintainability, testability .. RIA (Rich Internet Application) solutions will find a good trade-off between all these quality attributes. I'm not sure that Swing is the silver bullet :)
MAC
|
|
Message #206780
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Lifting desktop to web
Isn't it, like, easier to use one of many VNC Java Applet clients to actually open a desktop session in the browser? And it's not like the approach that Swing takes is the best one -- it' isn't really an application building framework, it's more like a rendering framework...
I think that approach of Wicket and Aranea (shameless commercial) is much better -- make web object-oriented, but don't try to lift the desktop to the web -- you lose more than you gain...
|
|
Message #206784
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Swing is good for RIA..
I do believe that Swing is the best solution for intranet applications. Java WebStart and Pack200 is really good for deploying applications. Pack200 is very good at compressing jar files.HTML based applications should be preferred only, if your application is available to public.
Swing has won unfairly bad reputation because of Java Applet failure. For example, one of the big bank in my country, they had implemented their banking applications with applet in 1999, it was a big failure. Because the applet size is about 2 mb and all the client's internet connections are about 33kbit.. They lost money and credibility. And they re-implemented it with servlet.
|
|
Message #206786
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
The magic three letters by information technologies ...
Maybe the first problem of Swing is their name - which is longer then 3 characters :) For this reason, here is a other new challenge: RSI - Rich Swinging Internet-Application ;-)
Now, in serious:
In my opinion Swing, SWT,... are destinated for applications, which needs a very restrictive status-handling and has a high frequently, complex structure and numerously input by the data-entry.
On the other side, Web-based solutions are great for solutions, which are more destinated to data-queries, with few need of data-entry and non-restrictive status-handling (Use of Browser's Back-Botton is no causing in a disaster...)
Swing/SWT/... needs today a fixed installation on the client-side (alternately downloading an applet) - this can produce problems by the maintenance of high volumed client-installations, but can be simplier with Web-Start, mayme ...
Web-based solutions needs only the browser. On the other side, all the handling/processing is destinated exclusively to the server-side, which can produce high traffic on potential slow communication channels and needs powerfull servers. Using JavaScript, perhaps can try trouble with the Browser-Compatibility. Maybe AJAX can resolve some of this problems in the near future.
BTW: I have seen good developments in commercial projects, which are providing great solutions for both areas - switching only the rendering-part on runtime to Swing, Web and others ... without any other specialized changes or definitions. Maybe Swing is applicable to RIA (R=Rich I=Internet A=Application) too ?
-roland
|
|
Message #206787
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
The magic three letters by information technologies ...
Oops. Sorry - the reply was correctly destinated to "Big whoop. Was done years ago."
|
|
Message #206790
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Swing is good for RIA..
If you are looking for a webstart type solution, check out jThinRich. It fills in the missing gaps of webstart. It provides a browser type metaphore for developers and provides a POJO http api to easily tie client actions to your servlet engine.
-Sam
|
|
Message #206791
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Not new..
echo2 provides a very similar API to swing/awt and is fully AJAX powered from the ground up with incremental DOM/HTML page updates. Very cool and open source.
-Sam
|
|
Message #206801
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Pointless
Rendering Swing window content as an image won't help to send data from browser to the server, so the most common use case - the data entry form - is not covered by this technique. What is covered, besides useful but well-known approach to charts? Right, image buttons. Hate them. Now I can use Swing to draw them. In-#$%^$#$-valuable.
|
|
Message #206807
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
The magic three letters by information technologies ...
Maybe the first problem of Swing is their name - which is longer then 3 characters :) For this reason, here is a other new challenge: RSI - Rich Swinging Internet-Application ;-) RSI means 'Repetitive Strain Injury'. I suffer from it and it's not funny.
|
|
Message #206834
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
The magic three letters by information technologies ...
Maybe the first problem of Swing is their name - which is longer then 3 characters :) For this reason, here is a other new challenge: RSI - Rich Swinging Internet-Application ;-) RSI means 'Repetitive Strain Injury'. I suffer from it and it's not funny.
I think, many abbreviations addressing different significances - without any coherency. The header of my posting and this thread too, are mentioned exxesive to a specialized theme of information technologies.
So, I very much apologize to those casual relation.
-roland
|
|
Message #206845
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
IMHO Echo2 is interesting but
check out jWings that provides an API that exactly mimics the Swing API (which Echo2 doesnt). It works and includes very many interesting tidbits and is exceptionally easy to style both with and without html-templates and css-files. I have also developed quite alot with Wicket as well as several applications with jWings and I must say that to use Wicket you must completely re-engineer your brain to get into it and for me, I have not really understood it yet but it works quite well in a cut-n-paste code factory.
With jWings your Swing-skills can be used directly. You can even take a swing application, search and replace certain class-names (JPanel -> SPanel for instance) and you have yourself a working webapplication.
I havent developed anything with Echo2 but since i discovered that it doesnt the use Swing-model and Ive been burnt by Wicket i find that Swing-style suits me and my need perfectly. I can easily switch between Rich Client and Thin Client programming without thought. /b
|
|
Message #206853
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Use applets with LMAppletserver
Instead of trying to render swing as images why not stick to applets using LMAppletserver?
Using LMAppletserver you don't have to worry about packaging applets or writing client-server communication protocols.
Applet code is written together with your server code, and is deployed automatically on demand to the web browser. You can access your server-business logic as easy as you would do when writing a client on the server.
Using LMAppletserver you'll get the power of Swing in your browser - and a very powerful and flexible development and debugging environment. Very rapid and flexible development of gui-intensive web-apps :)
http://www.lightminds.com/ShowDocument.asp?id=729
cheers,
Peter
|
|
Message #206855
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
IMHO Echo2 is interesting but
check out jWings that provides an API that exactly mimics the Swing API (which Echo2 doesnt). It works and includes very many interesting tidbits and is exceptionally easy to style both with and without html-templates and css-files.I have also developed quite alot with Wicket as well as several applications with jWings and I must say that to use Wicket you must completely re-engineer your brain to get into it and for me, I have not really understood it yet but it works quite well in a cut-n-paste code factory.With jWings your Swing-skills can be used directly. You can even take a swing application, search and replace certain class-names (JPanel -> SPanel for instance) and you have yourself a working webapplication.I havent developed anything with Echo2 but since i discovered that it doesnt the use Swing-model and Ive been burnt by Wicket i find that Swing-style suits me and my need perfectly. I can easily switch between Rich Client and Thin Client programming without thought./b Echo (the original) did follow Swing very, very closely. I was able to convert an Echo project to a Swing project very quickly.
They made some changes in Echo2. Not sure exactly why, but my guess is to more easily support AJAX. But really, there wasn't that big of change and other than some new widgets, it is very much like Swing. The concepts are definitely the same. Especially with EchoNG (previously EchoPoint).
I can't seem to google JWings. Got a link?
|
|
Message #206867
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Perhaps a better way?
This is something I've been working on for quite a while actually and I'm very near a preliminary release. There are some major difference in what I'm developing from the norm out there. My API is an entirely abstract UI (not Swing, but similar in many ways) so it's not specifically targetted to the web, nor is it specifically targetted towards applications. The abstract UI allows multiple implementations so you can write one UI and utilize it as a web application, a Swing application, an applet, a J2ME application, an SWT application, etc. without changing a single line of your code.
The web site will be at http://www.jseamless.org when it released (hopefully this week), but temporarily you can see a sample of a functional application here:
http://www.captiveimagination.com/wiki/index.php/Number_Guess
Constructive criticism is welcome and I am interested in anyone else interested in assisting the development of this API.
- Matthew D. Hicks
|
|
Message #206882
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Perhaps a better way?
This is something I've been working on for quite a while actually and I'm very near a preliminary release. There are some major difference in what I'm developing from the norm out there. My API is an entirely abstract UI (not Swing, but similar in many ways) so it's not specifically targetted to the web, nor is it specifically targetted towards applications. funny, iv been doing the same for myself and it works better for me than any other solution out there. As soon as one ditches the markup and goes "api" a world of possibilties sees light. I think swing API is just to rich and complicated and is therefore not an abstract GUI canidate. What kind of API style do you have. I basically implemented HTML and build more richer components on top of that. Works well for me.
|
|
Message #206891
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Perhaps a better way?
Dennis, I'd love to discuss this further if you want to e-mail me or message me over Jabber. My e-mail address is darkfrog@pyramex.com
The API I've been developing is focused primarily at offering elements that are shared between the web and applications (or at least can be created in both). I various components currently such as: Image (you reference the URL of an image resource), AWTImage (a drawable canvas that can be spit out on the screen as an image and updated), complete event management very similar to Swing's, the HTML implementation is completely AJAX driven, a TableLayout and BasicLayout providing the essential functionality of layout in HTML (far better than Swing's layout management system), and much more.
-Matthew D. Hicks
|
|
Message #206931
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Swing is OK to build RIA
I think Swing combinded with JavaWebStart is a great solution to build rich clients. The only problem I think is that the JVM is not as ubicuous as the browsers. But perhaps that will be solved when there are many applications available that would make the users download the JVM.
|
|
Message #206968
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Wrong approach
I don't think that you can project the complexity of the Swing API onto the client-side by rendering its components to images: - What about event handling? - Scalability: I cannot imagine running thousands of highly active sessions on a server which are rendering Swing components to images. - Network bandwidth: HTML-applications tend to saturate networks. If you are transmitting your user interface as images this will get worse.
If you really need the functionality of Swing on the client side while enjoying a server-side API something like ULC (http://www.canoo.com/ulc is far better suited.
--Bruno
|
|
Message #206989
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Swing is OK to build RIA
I think Swing combinded with JavaWebStart is a great solution to build rich clients. The only problem I think is that the JVM is not as ubicuous as the browsers. But perhaps that will be solved when there are many applications available that would make the users download the JVM. There sure are alot of people playing games on Yahoo - and they use Java.
|
|
Message #207131
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Echo2 is VERY interesting
I agree Echo2 is an interesting API and provides a lot of features. However, the problem is that your UI is completely dependent on the web. I believe the goal of the UI frameworks of the future should be to abstract as much away as possible so you can utilize your application as a web site and then can decide to release it as a stand-alone application without having to completely rework your UI or vice-versa.
Echo2 does show more promise as a web-based API than anything I've yet seen, it just seems the limitations come from having to convert explicitly to the web.
-Matthew D. Hicks
|
|
Message #207202
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Echo2 is VERY interesting
I agree with you. There should be a framework that abstracts the underline presentation framework used.
The same thing is the persistence: there should be something abstracts the framework used (JDO, Hibernate, etc.)
This should be the "Roma Meta-Framework" I working. I'm waiting adding some more features before to present officially the project on TSS ;-)
bye, Luca Garulli Blogging on: http://zion-city.blogspot.com http://RomaFramework.xwiki.com - The new way to build applications http://www.Pro-Netics.com (member of Orixo.com - The XML business alliance) http://www.OrienTechnologies.com - Light ODBMS, All in one JDO solution
I agree Echo2 is an interesting API and provides a lot of features. However, the problem is that your UI is completely dependent on the web. I believe the goal of the UI frameworks of the future should be to abstract as much away as possible so you can utilize your application as a web site and then can decide to release it as a stand-alone application without having to completely rework your UI or vice-versa.Echo2 does show more promise as a web-based API than anything I've yet seen, it just seems the limitations come from having to convert explicitly to the web.-Matthew D. Hicks
|
|
Message #207251
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Echo2 is VERY interesting
I agree Echo2 is an interesting API and provides a lot of features. However, the problem is that your UI is completely dependent on the web. Having "converted" an Echo project to a Swing project, I can say this isn't really true.
Echo2 does show more promise as a web-based API than anything I've yet seen, it just seems the limitations come from having to convert explicitly to the web. Any limitations are because of the limitations of html.
|
|
Message #207306
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Echo2 is VERY interesting
Having "converted" an Echo project to a Swing project, I can say this isn't really true. However, the "conversion" is still necessary. No matter how close they are there will always be a conversion necessary unless you have an abstract UI. The idea with jSeamless is that you can deploy it on the web and as an application in Swing simultaneously if you like and there isn't any UI synchronization that has to occur and hook up with the data model. Echo2 is a pretty nice system, and I'm sure the conversion process is not nearly as heavy as trying to convert from HTML to Swing, but until the conversion is no longer necessary you have to ask yourself why?
Specifically because Echo and Swing are so similar why not go one more step and make them one and the same? Then you have the best of both worlds and you can really have a "design first" approach because then you don't have to get an early decision on where this application will be deployed because it just doesn't matter anymore to the UI.
I've put up my preliminary work: http://www.jseamless.org but it is very early alpha. I will be completely re-writing many of the aspects of the API before the next alpha release. Comments and constructive criticism are much appreciated.
-Matthew D. Hicks
|
|
Message #207310
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Echo2 is VERY interesting
I think we are saying, or rather, thinking the same thing.
At the time, the conversion mostly consisted of changing package names and reversing some parameters in the table model.
With Echo2, it would take more work.
I'll give jseamless a look. I had wanted to do the same sort of thing.
|
|
Message #207314
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Echo2 is VERY interesting
Great, I look forward to some good feedback. It's still at an early stage of development, but that also means there's lots of room for change right now if you or anyone else that sees that has any ideas or is willing to help in the development the idea is to build the future of UI development.
-Matthew D. Hicks
|
|
Message #208509
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Best web based open source
Hi together,
i found the suggestions given here very interesting. I am looking for an open source tool where i can build a web application with tree, table, graph view of elements, exporting files, uploading files from client etc and i am not sure which is the best tool i can use for doing that. Previously i used to do all this with swing, but now the req are to make it web based and i am very much confused. Especially since i want it to be a really cool application with nice look-and-feel... I even checked out echo and i think its a great tool. I wasnt able to test all the functionalities but i think it includes quite some nice features.
What do you suggest for this type of appl ?
|
|
Message #221668
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re: Echo2 is VERY interesting
Currently I am doing some work on Echo2 framework and loooks pretty good to me as I can now avoid using those javascripts mix ups with JSP. Anyways when we talk about JSeamLess I can think of some usage of a databinding to the UI components.I hope you are taking care of this.
Rgds Shashank
|
|
 |
New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com |
 |
 |
Reza Rahman continues to explore the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(January 21, Article)
Ted Neward is an independent consultant specializing in high-scale enterprise systems, and an authority in Java and .NET technologies. He is the author and co-author of several books, including Effective Enterprise Java. At TheServerSide Java Symposium in March, he will be presenting sessions on pragmatic architecture, ECMAScript and Scala.
(January 15, Article)
Now that Oracle is absorbing Sun Microsystems, there mixed views on what should come of the Java Community Process (JCP). While some say Oracle should become the new steward of Java and keep the JCP much as it was, others argue that it may be time to open-source this widespread language.
(November 24, Article)
Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(November 2, Article)
SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options.
(September 28, Article)
Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team.
(September 22, Article)
Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies.
(July 14, Article)
JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags.
(June 29, Article)
In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project.
(June 23, Tech Talk)
Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now.
(June 15, Tech Talk)
In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements.
(June 15, Tech Talk)
In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls.
(June 4, Tech Talk)
Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable.
(May 28, Tech Talk)
This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work.
(May 26, Tech Talk)
Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers.
(May 21, Tech Talk)
Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application.
(May 19, Article)
Download the entire book of Jakarta-Struts Live and learn about Struts MVC, Tiles, the Validator, DynaActionForms, plug-ins, internationalization, and more.
(Book PDF Download)
The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)
|
|