wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Rich Internet Applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Rich Internet Applications" Watch "Rich Internet Applications" New topic
Author

Rich Internet Applications

Dave Robbins
Ranch Hand

Joined: Sep 16, 2003
Posts: 131
anybody have any thoughts on the new slew of tools for creating RIA's?
I think an applet talking to a servlet on the backend is great and don't understand why all the new gadjets
my first real experience with java was a couple of years ago building a quite elaborate applet that unfortunately had to talk to IIS and ASP but never the less I was hooked
It doesn't even seem this approach is even very popular these days, I just don't get it
BTW, I know I'll get a rather biased opinion from a java development portal

Dave

oh yea, thanks for all the help I've received here
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
Well I'm pretty close to you - but I'd use a Java Web Start application (still starts from browser, but user can create shortcut on desktop and can run without browser) talking to Web Services (instead of servlets - what format did you use to pass your data back and forth with servlets - I see this as the advantage of web services - its still just HTTP but it defines data types).
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by Tim LeMaster:
Well I'm pretty close to you - but I'd use a Java Web Start application (still starts from browser, but user can create shortcut on desktop and can run without browser) talking to Web Services (instead of servlets - what format did you use to pass your data back and forth with servlets - I see this as the advantage of web services - its still just HTTP but it defines data types).


++ on Web Start. The problem I am seeing is there is such a big focus on JEE right now. So all the latest and greatest tools and API are geared towards that. Desktop API's like Swing have taken a back seat. Not so much with enhancements and features. I know Java1.6 is going to contain the most Swing changes we've seen for a while, but making developing Swing apps easier is still something developers are longing for and aren't getting.

I don't consider a gui builder/designer in this category either. Sure, they are nice, but I am thinking a framework for wiring Swing apps together, a higher level API for building Swing apps. You know, rather than creating a JFrame, adding a Menu Bar and Tool Bar, etc, why not have a JApplication that just accepts some cool configuration for defining the menu bar and tool bar? Why must I always code an event for exiting my application? Little things like that.

I think I'm going to move this to the Swing forum. I'd like to see some discussion on this from other Swing'ers.


GenRocket - Experts at Building Test Data
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
Yeah there is a huge focus on JEE but I for one get tired of all this enterprise architecture and then the UI is a mash of HTML, Javascript, DHTML, css, etc...

I love sitting down and writing a swing app an being able to write code like

JButton okButton = new JButton("OK");
okButton.addActionListener...

Wow I just wrote an GUI widget and event listener all in Java. Instead of having to use HTML and Javascript and CSS to make it look like something.

Why don't web applications look like applications? Why don't they have standards for menus, and short cut keys, and all the other stuff we take for granted on a desktop applications - or more to the point why does everyone want a web app?

Am I the only one who feels this way?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

I think convenience is a big factor for wanting a web app. Nothing to install so long as you have a browser. No need to worry about having the right version of software (all the VM version running around) which is partially Sun's fault. VM download size for the plugin is a bit large.

Flash is getting a good look these days for things like Flex and OpenLazlos which you can in escense build a gui application that runs in a web browser. And EVERYONE has flash installed. If they don't, it takes 30 seconds.

There are web frameworks that make building web apps more Swing like. WingS for one. Echo2. Wicket gets close, but not quite there. I just think it's all about what's hot and what pays the bills.

You can think of it this way. What if you wrote a JWS App in Swing and I wrote the same app as a webapp. We wanted to show off our app to a very non-tech person. They don't have the JVM already installed or they have the wrong version. Which one do you think they would prefer? So that aspect needs to be addressed.

I love sitting down and writing a swing app an being able to write code like

And that's another thing. Other people don't love that.
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
Do they love sitting down and saying - Ok I produce this JSF app that has a radiobox - now I want to update the screen when the pick one.

So first do I do a full page reload or AJAX. Well its got to be AJAX because the user doesn't want to see a full screen refresh.

Ok - so now I need some javascript - better make sure to use a javascript framework that is cross-browser - oh and integrate it with JSF.

Hmm do I use the full JSF lifecycle or do I process AJAX calls outside of the JSF lifecycle?

Do I use XML or JSON to send my results back and forth.

All this to get and process a radio button event?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by Tim LeMaster:
Do they love sitting down and saying - Ok I produce this JSF app that has a radiobox - now I want to update the screen when the pick one.

So first do I do a full page reload or AJAX. Well its got to be AJAX because the user doesn't want to see a full screen refresh.

Ok - so now I need some javascript - better make sure to use a javascript framework that is cross-browser - oh and integrate it with JSF.

Hmm do I use the full JSF lifecycle or do I process AJAX calls outside of the JSF lifecycle?

Do I use XML or JSON to send my results back and forth.

All this to get and process a radio button event?


I guess they do. They are doing it aren't they. Of course, anyone that loves to sit down with JSF is on crack. Here is your homework assignment. Make the same argument against Swing for a radio button with an event. It can be done. I am a firm believer in use what is best to solve the problem. If a web app solves the problem, great. If a desktop app solves the problem, great.

It's not always development time and ease of development either. It's about the end user experience. So Tim, can you give me an example of a web application available today that you believe is a better fit as a Desktop app? Can you give concrete examples as to why you feel this way?

[Keep in mind I am on your side but it's fun to debate and I like playing devil's advocate.]
[ September 15, 2006: Message edited by: Gregg Bolinger ]
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
Sure I'll steal the example used at JavaOne during one of my favorite presentations - "Its Not Over Till the Fat Client Sings" - Megan Beynon, IBM; Joe Winchester, IBM UK

Google Maps (Web) - Google Earth (desktop)
2D versus 3D
Flat map versus Building models in some cities


Heck Google mail is cool - but would its interface be very hard to do with Swing (or any desktop GUI API).

Heck I'm put on the extreme hat for a minute - even this forum. Editing text in these forums is like using Word Perfect back in the DOS days - pre WYSIWYG - with special blocks that format the comment - but you don't see what it looks like till you post.

I'm also all about End User experience - thats why I prefer a rich GUI client

[absolutely - I love to debate and I've played devils advocate - many times myself - even on this topic - which I'm very passionate about]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

This is fun. Ok, here we go.

Google Maps (Web) - Google Earth (desktop)

2 different purposes. Google maps is competition for MapQuest and the like. It happens to be able to show satalite imagery which is pretty cool. I am looking for directions, nothing more. Google Earth, good for geotrackers and people with too much time on their hands that want to see the world without leaving their house. Discovery and History channel are good for this as well.

Google mail is cool - but would its interface be very hard to do with Swing (or any desktop GUI API).

Again, it's not about if it would be hard to do. I love GMail. I like being able to check my mail from anywhere. With the current state of Swing and the JVM, would this be possible no matter what computer I was on? I don't think it would. Sure, you can build similar features in a desktop pop mail client. But is it really better?

even this forum

That's a stretch. But I have thought about this myself as well. Again though it comes down to accessibility. I can post to Javaranch from my cell phone right now. Not possible if it were a Swing app.

Now, should there be desktop alternatives to popular web applications? Sure, I'd be all for that. I think it would be cool to have a better interface for JavaRanch. But would I want that to be the only interface? No way.

I'm also all about End User experience - thats why I prefer a rich GUI client

Exactly, and your computer is running the latest and greates JVM. It's fast, lots of disk space, lots of RAM. No problems. But that's you. And software development isn't about the developers. And you can't make everyone happy.

So let's shift this converstation a bit. What can be done to make Swing desktop apps more appealing to developers? What tools do they/we need? Now flip that into what can be done to make Swing desktop apps more appealing to end users. What can be done to make them more accessible? Are any of these things possible?
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
Again, it's not about if it would be hard to do. I love GMail. I like being able to check my mail from anywhere. With the current state of Swing and the JVM, would this be possible no matter what computer I was on? I don't think it would. Sure, you can build similar features in a desktop pop mail client. But is it really better?

Sure I'm all for a lightweight portable UI - but most the time I'm on my laptop with my software - So why can't I have my advanced desktop app. Even if I need the JVM I have to download it once - this is no different than Flash - we just need to get the JVM out to everyone.

now, should there be desktop alternatives to popular web applications? Sure, I'd be all for that. I think it would be cool to have a better interface for JavaRanch. But would I want that to be the only interface? No way.

Well now I never said the only interface. Implement the core of the code as Services and each UI can utilize the services. As a side note this also makes it easier to code things like new post tickers, private message popups, etc. Easier for the developer is important to the user, the developer has more time to spend on more features - its about bang for the buck.

So let's shift this converstation a bit. What can be done to make Swing desktop apps more appealing to developers? What tools do they/we need? Now flip that into what can be done to make Swing desktop apps more appealing to end users. What can be done to make them more accessible? Are any of these things possible?

I'd like a really cool Swing and SWT GUI visual editor for eclipse.
I think this Swing Application Framework JSRs might be nice - but I don't need it.
[ September 15, 2006: Message edited by: Tim LeMaster ]
Dave Robbins
Ranch Hand

Joined: Sep 16, 2003
Posts: 131
what format did you use to pass your data back and forth with servlets

to me, the beauty of using java on both ends is you can pass objects back and forth
In my case all I want the servlet to do is run a database query and return the result
a ResultSet isn't serializable so I made a custom class to hold the data
I viewed a ResultSet as a collection of rows where each row is a collection of fields, a collection of collections
so my class contains a Vector where each object in the Vector is itself a Vector, a collection of collections
it also contains all the column names and other metadata
I haven't really messed with web services, I guess I should look into them
so many API's, so little time

Dave
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

http://www.indicthreads.com/interviews/501/swing_ui_mature_ajax_infancy.html

Interesting article that delves into what we have been discussing.
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
I've considered this issue a lot. I love writing rich client applications and dislike writing web uis. Web uis are fine if they are simple, but users always want more. They want interactivity which is a pain in a web app. Javascript is a nightmare, and it is also very difficult to seperate your display and your behaviour. Ajax helps in some ways but still it's really papering over the cracks, underpining it is still javascript is not viable as a enterprise level language.

Swing is great but is confusing and lacking in some areas. Some of these are covered with 3rd party frameworks - jgoodies/netbeans etc. It would really help if we had more standard components, in particluar :
Tri-state checkbox
Type-ahead support
Better layout managers that handle the common cases much better.
A date picker.
Table Sorting (coming in 1.6 I think)
Print preview.
Print options panel.
Font chooser.
Action management for large applications.

We also need patterns for layering/organising swing uis. I know of no book that does this and the web resources are also very poor. Compare this to the number of books in the web development world. I think this maybe one of the biggest issues, people don't have a pattern to follow and feel lost.

D.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Tri-state checkbox

Not sure what that is

Type-ahead support

This seems like something really easy to do with a KeyListener. Have you tried it?

Better layout managers that handle the common cases much better.

JGoodies FormLayout
MigLayout - I just found this one tonight. Looks pretty good

A date picker.

JCalendar
SwingX Date Picker - This could be moved into 1.6 but I am not sure.

Print preview.
Print options panel.


They are there, but not user friendly. The print features of swing need a lot of work, I agree

Font chooser.

l2frpod - has one.

Action management for large applications.

There are actually a couple of these out there. Including one in the SpringRCP stuff.

With all that being said, all this needs to be CORE swing stuff. You shouldn't have to scouer the web to find everything to build a gui. Swing should provide you with most everything you need. Write now I'd say it provides about 60%.
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
Tri-state checkbox

Checkbox with tick, cross and blank


Type-ahead support

This seems like something really easy to do with a KeyListener. Have you tried it?


Yep, in each of my last 3 jobs. It's suprisingly difficult, the naive implementation doesn't work (in my experience). Plus there a few different types of type ahead combo.


Better layout managers that handle the common cases much better.

JGoodies FormLayout


FormLayout still doesn't handle the common cases that well, although it is a good framework to build on.

Action management for large applications.
There are actually a couple of these out there. Including one in the SpringRCP stuff.


I don't think any are that good though.



With all that being said, all this needs to be CORE swing stuff. You shouldn't have to scouer the web to find everything to build a gui. Swing should provide you with most everything you need. Write now I'd say it provides about 60%.


Exactly. My job is creating and maintaining a ui library, that essentially incorperates a wide of variety of components (including most of the ones above.). They are of very different standards. This is good for me in that it's a job I love doing, but it's not so great for Swing and Java on the desktop.

Another thing we also need is a good docking framework!
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
My 2 cents (actual retail value may vary)

Tri-state checkbox
Not sure if this is very standard. Whats next a quad state checkbox.
I have a feeling alot of people might implement this as a radio list.
Not that I disagree with it, but it would be very low on the list of
things I think Sun should work on.

Type-ahead support
Implemented this once or twice, didn't have much trouble with it, a few
minor nitpicks, but again it works pretty good.

Better layout managers that handle the common cases much better.
Yeah, this is a good one. It wasn't until a saw matisse that I thought
someone made it easy to align things simply. Of course then you have to
deal with the generated code

A date picker.
Definately - its almost a crime Swing doesn't have a built-in somewhat
decent date picker. JCalendar - a free component - my buddy tried to use
has several problems. I posted a code sample and some fixes on its forum
20 days ago and not a single response.


Table Sorting (coming in 1.6 I think)
Print preview.
Print options panel.
Font chooser.
Action management for large applications.

These aren't near or dear to my heart so I'll just say a blanket statement as I haven't done any of these. Unless you mean sorting in a JTable and that wasn't very hard - I implemented this with 2-way sort with a icon indication on the column header.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Another good read this is spot on for this discussion.

http://www.onjava.com/pub/wlg/8964
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I posted on the Struts forum and Gregg pointed me to this thread...sounds like some of you have the same thoughts:

While we are talking about web development and frameworks, I will throw this out...

I have not been able to get too excited about frameworks that provide an incremental improvement over Struts. The reason is that most of them are built to create the same crappy fill out an html form, submit a page, click a link, refresh the entire page type web applications that Struts is designed to produce. I would love to see the web move towards a rich interface, drag and drop, right click, dynamic refresh model (Web 2.0...like the apps that Google is making famous). On the other hand I am not real excited about producing a bunch of client side JavaScript and I am not sure that I want a framework that produces a bunch of JavaScript either (like the framework that Google released).

At some point I have to wonder if we will be able to break out of the browser and away from HTML and JavaScript. I wonder about the feasibility of Swing based applications deployed with Java Web Start that retrieved data from the middle tier using web service calls over HTTP. Or maybe applet development will come back into vogue. I have seen some nice applications developed with ActiveX (or whatever Microsoft calls that technology these days) but I am not a huge fan of solutions tied to Windows or IE.

In a previous life I used to be a proud graphical user interface developer. I started out with Visual C++ and moved into Visual Basic. Sure VB gets a lot of slack, but I was proud of the user friendly interfaces that I was able to produce. Then the web revolution hit, the job of the GUI developer job turned into fighting with html and screwing with browser compatibility issues so I ran as fast as I could to middle tier development. Lately I have been doing a mix of EJB and Struts development.

Some time around 1999-2000 I spent about 6 months developing an applet based reporting tool. I am not sure if it ever made it into production. It was a decent concept even if the user interface was still a bit weak. A user could drag around fields and columns and drill down into data. It streamed Java objects back and forth to the servlet tier as described in Jason Hunter's "Java Servlet Programming" book. It was not a public Internet application so we were able to dictate that the client had Sun's Java Plug-in installed.

A comment or two on Flash (with Flex and OpenLazlos)...I stopped installing Flash because I found that after setting up a new computer without Flash I had to sit through a lot less ads. Flash seems great but I have found that it is used most these days to create really annoying ads. Earthlink had a beta version of their online email client that was based on Flash and it was pretty good. I have not used any of these tools, but I wonder how enjoyable (or even possible) it is to develop a large scale application with Flash.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rich Internet Applications