Software Reality
Programming with
a dose of satire.

Site Map Search


Matt Stephens
 
Use Case Driven
 
Agile Development
 
Extreme Programming
 
Code Generation


Articles
Lifecycle
Design
Programming
Soapbox
Reviews
Cthulhu

Use Case Driven
Use Case Driven Object Modeling with UML: Theory and Practice
Get from use cases to working, maintainable source code. Examples use Spring Framework, JUnit and Enterprise Architect

Agile UML
Agile Development with ICONIX Process
A practical subset of agile development techniques, illustrated by example

Get Controversial!
Extreme Programming Refactored
Extreme Programming with a dose of satire
Available now:






Check out our ageing Reviews Section



T-Shirts etc.

Software Reality T-shirt

Wear a swanky Software Reality T-shirt under your suit, and prove (at least to yourself) that you don't follow the crowd.

Software Reality mug

Or if you're feeling bold, carefully place an official Software Reality mug on your desk!



Soapbox

11 Essential Things Swing Needs in Order to Survive . . .

Java Swing Survival Guide

By Matt Stephens
February 29, 2004

"Just barely good enough" is a maxim that has defined Swing since its earliest release. Way back then, its MVC approach to lists and tables, its "platform look & feel" approach and its flexibility meant that in many ways it represented a giant leap forward in UI programming. Trouble is, Swing UIs were also pig-ugly and slow. The result was a toolkit that was just barely good enough for its purpose.

With J2SE 1.4.x and now 1.5, Sun have taken great strides in improving Swing. It's faster, and the new Ocean theme (though it still draws criticism) is a big step forward in the modernisation of Swing's look, if not its feel.

Trouble is, the rest of the world has advanced apace - and in certain cases (as we'll explore in this article) leapt ahead of Swing. As a result, Swing's recent improvements fail to address certain key issues that may prevent its wholesale adoption.

Not all of these issues are directly to do with Swing; some are to do with obstacles generally preventing widespread adoption of Java on the desktop. So with that in mind, let's explore the issues that really face Java's acceptance on the desktop - and what Sun needs to do to fix them.

 

 

 

1. Reclaim the Browser

Most people who have heard of Java, but don't know the language, have also heard of Java applets. Applets are to Java as underpants are to Superman. Applets helped to launch awareness, adoption and acceptance of Java in the early days. To the non-hardcore, they're as much a part of the Java brand as Java itself. And yet, these days Sun treats applets as if they're the mutant offspring that they want everyone to forget existed; locked away in the basement, fed through a grill in the door, doomed to watch reruns of "I Love Lucy" in near-darkness for the next 20 years.

The general consensus seems to be that Java WebStart (JWS) has superseded applets. But applets still have a function to fill: dynamic content embedded directly in a web page. The trouble is (apart from the fact that Sun seem almost ashamed of this "hideous monster") that for a web designer, it just isn't very easy to create dynamic web content using applets. For these people, Flash is a much more compelling option. Flash MX makes it as easy as drag & drop to create dynamic movies or interactive "rich client" user interfaces that are deployed in the web browser.

These days, Flash is omnipresent (especially if you believe Macromedia's claim that Flash is installed on 98% of browsers on the desktop!). So for web designers, it's a "no-brainer" to create dynamic content using Flash. However, Java is becoming increasingly common on end-users' PCs. Sun have gone to great lengths to make this happen (with OEM bundling deals, marketing, attempted lawsuits and so forth). It would be a shame if they didn't capitalise on all of these efforts by making Java applets the choice for creating browser-based rich clients.

A major stumbling block is that Java applets' browser integration (particularly with DHTML) is very poor. When creating a DHTML web page, the web designer thinks in terms of layers. He wants to be able to overlay different areas of the page on top of each other. This is a standard part of the DHTML spec. And yet, if you try to do this with a Java applet, it behaves as if it's the only element on the page, blotting out anything placed above or below (see the associated bug report). Applets need to be a well-behaved DHTML citizen; respect layers and so forth. Being able to create a translucent applet layer hovering over a DHTML page would be incredibly cool. But until this rather glaring bug is fixed, it remains a slightly damp dream.

Another possibility (although this is admittedly slightly "out there") would be for applets' browser integration to be stepped up a few notches; for the applet to become an integral part of the DOM; and (this is the way-out part) for an applet canvas to not be restricted to one part of the page. That is, wouldn't it be great if you could define several DHTML applet layers, on different parts of the page, that are actually part of the same applet?

This could be achieved by using an "AppletLayer" HTML tag, including a "canvasID" attribute. For example:

<AppletLayer applet="fred" canvasID="1">Your browser doesn't support applet layers. Time to upgrade!</AppletLayer>

Then in the applet itself, the paint method would be something like:

public void paint(Graphics g, int canvasID);

This approach would also mean that applets could span multiple browser windows (e.g. control and be part of a popup window).

Another area where applets should be more tightly integrated with the browser is with generation and capturing of events. It should be easy to create an event listener so (for example) if the user clicks on an HTML form submit button, your Java code can receive the event as if it was a Swing button that was clicked. Similarly, it should be easy to capture browser events (page reloading, page enter/exit etc) in your applet, and to generate browser events from the applet.

With the increased presence of Java on PC desktops worldwide, Sun has an opportunity with Java applets to reclaim the web browser; to steal the mantle back from Flash. But to stand a hope of achieving this, there are a few more things they need to do first:

 

2. Create a Website for Creating Rich-Media Applets

To win the desktop/browser war, Java needs to win the hearts and minds of web developers. They're a creative bunch, and they're generally not expert programmers. A quick visit to the DreamWeaver Exchange shows that Macromedia have recognised this fact, and appear to have got it exactly right (and while you're there, drool over that Flash UI!)

Sun could use Java to their advantage however, and go several steps further.

Sun needs to make it easy and desirable to create media-rich Java applets. To do this, they need a Macromedia-style website that shouts "Design!", and includes downloadable Swing components for things like: viewing mpegs; SVG support; popup calendars; plus lots of "little" components for things that web designers will typically want to create (text transitions, sprites etc). Plus users should be invited to submit their own components for inclusion, much like the DreamWeaver Exchange.

These types of component are already available elsewhere; but Sun desperately need to create a first port of call (I'm trying to avoid calling it a portal!) containing a standardised, official set of quality, applet-ready components.

Needless to say, the source code for these components should also be included so new programmers can learn by example. At the moment, far too much is left as an exercise for the reader, with not enough cool, working example components.

It should be easy for web designers to just drop these Swing components into their NetBeans Swing form editor. Download, click click click... there's your rich-media applet, no programming required. In fact, why not let NetBeans connect directly to this on-line repository of Swing components, allow you to browse for components through its rich-Swing interface, then download and install one of the components automatically, so that you can drag the component directly onto your form? That would be very cool.

The technology is there to do all this quite easily; Sun just need to bang the rocks together and do it right.

If Sun could create a central repository of components, and make them really easy to browse and use, then they'll be in a much better position to take on Macromedia at their own game.

 

3. Create a Vector Look & Feel

You might not believe this, but Swing really can be made to dance. There's an example here of a vector-based Swing look and feel. (Check out the demo applet, and the JavaLobby discussion). It really does look like Flash! If the demo seems slow, it runs better on the new J2SE 1.5beta - but the look & feel evidently needs to be optimised. But the point is that Sun have it within their grasp to bring Swing kicking and screaming into the twenty-first century (right now they're hard-pushed to bring Swing into the late-1990's).

A standard, heavily optimised (i.e. fast) Vector look & feel would be a big step forward in giving Swing as compelling a UI as Flash. But the Swing components themselves need to be more powerful. Which brings us to the next item…

 

4. Swing Components Should be More Powerful

The standard Swing component set hasn't changed for the last 4-5 years. These components remain just barely good enough for the job: but as their competitors get better, the Swing component set has become, like, so 1998.

Swing needs a UI painter app, like Flash, where you paint UI elements and script them on a timeline. How easy is it to do animation in Swing? Hard. It should be easy to drop a panel of Swing components on a page, then set up a simple transition with elements flying onto the page, fading in and so on.

Swing neads to expose more of Java2D. Currently (for programmers new to Swing) it isn't obvious how to mix the two. Transition effects, animation and so forth should be built into the Swing components, and easy to create via an IDE.

Swing containers should be inherently dockable. Each container should have an isDockable() property. If it's set to true, then the container can be dislodged from its location on the screen, dragged around, and docked elsewhere. There should also be a concept of "docking groups", so the programmer can stipulate that only certain groups of containers can be docked together. Each component should also remember its original location so it's easy to revert everything back to its default layout.

JTable needs a super-powerful successor with Excel-like capabilities. The basic component shouldn't change (changing JTable now would be bad). But the javax.swing.table package needs to include at least one custom subclass (let's call it "JXTable").

For example, JXTable would allow sorting of columns, dragging columns around, easy keyboard navigation, multi-column and multi-row cells, mixed-size fonts and so forth. In short, adding a JXTable to your UI should be like dropping a modern spreadsheet into your application.

If you think about how powerful JTable/JXTable could be, you begin to realise how lame the current implementation actually is. Once again, it's "just barely good enough" (and barely even that).

 

5. Improve IDE Support

If desktop Java is to stand a chance of staying relevant, it needs to be made very easy for web designers to create dynamic content. Sun could address this by improving applet support in NetBeans; creating a media-rich drag & drop environment in which beginner programmers can easily create and deploy graphical applets that look more like Flash movies than AWT "clunkettes".

Talking of NetBeans, their Swing form editor used to be cutting-edge, but it hasn't been updated for a long time (several years). It no longer looks the part; in fact it now looks distinctly tired; frayed around the edges.

To attract new client-side Java programmers, Sun badly needs a dynamic, cutting-edge Swing form editor. The quickest way they're going to get this is to build on the form editor in NetBeans. They also need to provide support for modern layout managers, particularly SpringLayout.

IDE support for individual components needs to be improved. For example, JTable (were JTable to be the super-powerful spreadsheet-like component that it should be) could have its own editor support for dragging and resizing cells, defining dynamic data-bound rows and so forth.

Customization of components' paint methods (paintBorder, paintComponent etc) should also be turned into a drag & drop process, e.g. defining a series of blending effects from a palette of presets, curvature of corners, component animations and so forth.

For an example of what a real Swing IDE should provide, take a look at SwishZone (a Flash IDE).

 

6. Improve Connectivity

In recent years, Macromedia have shown how easy it can be to create a stunning looking web-based front-end that connects to a J2EE back-end. Winning the battle for the desktop is as much about enterprise development as it is about widgets and toggles.

With Flash, it's possible to (or more to the point, it's easy to) create a rich-client browser-based application that connects to a J2EE (or other) application server. The resultant UI (see Macromedia's Pet Market example) is a striking example of what's possible, and is absolutely streets ahead of what Swing can currently do. If Sun don't recognise that Flash is the true competitor to desktop Java, then Swing is frankly doomed.

Luckily, desktop Java does have some pretty major advantages over Flash:

Java is a true object-oriented programming language; it's also mature and has lots of libraries
It's difficult to auto-generate Flash apps. With Java it's easy
Java has RMI, Flash doesn't. This means that Java applets can communicate with a J2EE server using remote objects. Flash has to rely on "kludges" (or web services, which are less than ideal) to communicate with a remote server. This is possibly the single most important advantage that Java has over Flash (but as killer advantages go, it's woefully under-utilised)

For these advantages to make a difference, Sun needs to capitalise on them and make it easy for developers to create amazing-looking rich-client applets that connect to a J2EE server (which brings us back to the need for better IDE support). Java is easily powerful enough to do all this already, but it needs killer IDE support to make it easy to do this sort of thing (just like Flash already has).

To do a proper job of this, the Swing team need to identify the most common tasks that programmers use Swing (and Flash!) for in a networked environment. For example, simply filling out a form and submitting it. This is probably the most common task for a browser app (rich-client or otherwise). So Swing (or its IDE support) needs to make it very easy to create network-aware forms, and to hook these forms up to a server-side form handler.

Ideally there should be a package of network-ready extensions to Swing (e.g. javax.swing.net, or javax.swing.netforms) that IDEs can readily take advantage of.

Pet Market
Sun gets smart with the latest release of Swing? If only...

 

7. Make Swing Simpler (but Keep the Flexibility)

One of Swing's main advantages is its incredible flexibility. If there's something you need to do with your UI, Swing will get you there. You might have to write a custom tree-cell renderer, or even your own custom look & feel, but ultimately you will be able to achieve what you need to using Swing.

Unfortunately, this flexibility comes at a price. Swing has a steep learning curve for novices. It's also difficult to master.

To attract new developers, Swing needs a shallower learning curve. There are currently too many "gotchas" and inconsistencies facing the novice Swing programmer. A common mistake is to try to add a component to a JFrame using frame.add(..) rather than using frame.getContentPane().add(). (Thankfully J2SE 1.5 fixes this). Same for JScrollPane.setViewportView().

Talking about scroll panes, it should be possible to simply tell a component that it's scrollable. Having to add a component to a separate JScrollPane component might be a great design pattern, but it confuses the hell out of beginners. Why can't they just set textArea.setScrollable(true) - which probably should be the default - and let the component take care of the rest? Swing components need to work with the programmer to get results quickly, not sit there blithely insisting that the programmer follow some ivory-tower design pattern.

JTrees are also too complex for most common uses. The flexibility - the ability to customise any aspect of a JTree - is great, but the need for customisation kicks in too early. It should be possible to do more with the DefaultTreeModel and default renderers.

Perhaps it isn't Swing itself that needs to be simpler. Rather, the GUI form designers need to be more powerful. NetBeans makes some steps down this road, but falls far short of what's needed.

 

8. Fix Bugs Faster

As we all know, some Swing bugs have been lying dormant in the Java Bug Parade for years. It's getting beyond a joke. If Sun doesn't have the resources to fix these bugs in-house whilst still providing the next-generation UI toolkit that Swing so desperately needs to be, then perhaps open-sourcing Swing is the answer.

I'm not actually a great advocate of open-sourcing Swing (or Java, for that matter). Why should Sun "give Java up" after they've invested so much time and money in it? But if it's the only way they can produce the software they need to compete, then it might just be their best option.

 

9. Improve the Layout Managers

These days, I've grown used to creating Swing UIs using a mixture of BorderLayout, FlowLayout and GridBagLayout. These three layout managers used together are good enough for most layout purposes. But (and you can probably see a theme emerging here), "good enough" just doesn't cut it any more. Swing needs to be inspired; a shining example of simple, elegant yet powerful design. GridBagLayout doesn't really give us that.

Swing's layout managers need to be rethought so that they're easy to use. They also need to be more IDE-friendly. If it was easy to create a drag-and-drop, WYSIWYG Swing form designer, every IDE would have one.

SpringLayout gets us part-way there, but we're still not seeing the all-important IDE support.

 

10. More Optimisation Needed

Swing has become a lot faster and more responsive in recent releases. And yet, for some reason, using a Swing app still feels like running through treacle. Actually that's not entirely fair: if all you used was Swing apps, they would seem responsive enough. But as soon as you switch to a well-written native app, you immediately see the difference. These days we're using 2-3 Ghz PCs: our UIs should be incredibly snappy, not "just snappy enough".

The impression I get is that Swing needs to be rewritten from the inside out: have its guts ripped out, replaced with new, super-efficient code that paints at lightning speeds.

 

11. Make Anti-Aliased Fonts Easier to Use

Java2D obviously has support for anti-aliased fonts. And yet, bizarrely, Swing doesn't use these by default, or make it easy to switch them on. Currently you have to override a component's paintComponent method and set its graphics context's rendering hint to use text antialiasing -- which essentially means you need to create custom components just to use antialiased text. A simple "isAntialiased" property would be nicer, and more obvious for programmers who are new to Swing.

Antialiased text in Swing appears to be on its way, but the solution-in-progress seems unneccessarily complicated (why not a simple isAntialiased property?). While Sun makes big noises about making Java simpler, Swing continues to complexify.

Human nature is to use whatever defaults they're presented with and to leave it at that. Programmers work to tight deadlines. So if their Swing app is just barely good enough (like Swing itself), they won't go the extra mile to make it look smooth and shiny. They might not even be aware that the extra mile is available to them.

The result is that most Swing apps look horrible (and will continue to do so, it seems), even though the option is there, just hidden beneath the surface, to make them shine.

 

Conclusion

Adoption of Java on the desktop is improving; big-name PC OEM bundling deals are being secured; and Sun's Java Desktop (Linux with a bundled JRE) also appears to be doing rather well. To really win the desktop war, though, Java needs a built-in windowing toolkit which is more than just barely good enough. SWT isn't it; it's basically doing the same things as Swing using a different approach to rendering.

What Java desperately needs is a butt-kicking GUI toolkit that's as powerful and creatively inspiring as Flash but with the inherent maturity and power of Java. Luckily, the improvements that Swing needs are very clear-cut and obvious.

You may have noticed a certain preoccupation with Flash in this article. That isn't by coincidence. Considering what Swing is capable of, and the areas where Swing should be the only serious choice, it turns out that Flash is Swing's most dangerous competitor - much more so than SWT.

Java/Swing should be the first choice for creating easily deployable dynamic web content. But in terms of looks, responsiveness and ease of development, Flash wins hands-down.

In short, Sun need to recognise who their real competitor is, and improve the client-side Java experience by taking their inspiration from Flash. The result - a vector-based UI that loves web browsers, with excellent IDE support and J2EE connectivity - combined with the advantages that Java already has (a mature, multi-platform OO language, "built-in" remote object broker, increasingly common runtime on new PCs etc) would make Java on the desktop virtually unstoppable.




Talkback: Have Your Say

Post a new message

Message Index:

Poor examples
Anonymous person anon

Dear anon...
Me

On Layout Managers
Karsten Lentzsch karsten@javagoodies.com

You're right
P.Jourdan

Lots of good points
David david_lewis_bates@hotmail.com

the sad thing..
dog dog@dog.com

JXTable
Jesse Wilson jesse@swank.ca

maybe what we need
dog dog@dog.com

JXTable or Glazed Lists should support multi-column sorting
AK appmath@yahoo.com

swing can be anything
Kamal El Bedraoui kamal@nic.fi

I think Sun is pretty much ignoring Swing not just applets
J Carlson carlsonjf@hotmail.com

One idea might be to create a more simplified wrapper to swing & java2d that use ...
Anonymous person

Flash with Java
Branko

Flash is not the enemy
Joe

Sun needs to wake up
David Simmons david.simmons@fmr.com

Check out Flex
Dino Fancellu

One good thing about SWT ...
Anonymous person

JXTable
Cameron Zemek grom358@yahoo.com.au

Check out Laszlo
Dino Fancellu

Solution for Swing problems
Ed Tidwell ed-tidwell@nc.rr.com

I completely agree
JavaUser

JXTable
Anonymous person

JXTable
MeToo

Its Already available
Mark mark@mohc.co.uk

about documentation
Michele Nardelli mnardelli@crema.unimi.it

Doubt in java swing
rama rama_13984@yahoo.co.in

if you like flash then use it
Anonymous person

new functionalities required!
Arvinder S Channey [ aschanney@yahoo.com ]

new functionalities required!
Arvinder S Channey [ aschanney@yahoo.com ]

super
karthick it_karthick2005@yahoo.co.in

Proper Grammar
Bill

It is annoying to be distracted by glaring nobheads who feels the need to add no ...
Anonymous person

OK, grammar?
Dave djrup@yahoo.com

The beginnings of this are underway
Ismail Degani deganii@gmail.com

Swing mouse pointer not shown
kalaivanan kalaivanan.vaithilingma@wipro.com

Compare Swing components and ActiveX
Deshpande

Is this the answer?
Marc marc@-r-e-m-o-v-e-sitdown.org.uk

Managed Hosting, Colocation and Data Center Services by victoryushchenkonashpres ...
Robert robert@fret.uk

why should i go to Drag & Drop in swing
karthik karthikkumar.karu@gmail.com

why should i go to Drag & Drop in swing
karthik karthikkumar.karu@gmail.com

problem with java
prajakta deshpande prajakt.deshpande23@gmail.com

Why Swing is struggling
SwingFan SwingFan@microsoft.com

Why Swing is struggling
SwingFan SwingFan@microsoft.com

different types
val 9a9a9a9@gmail.com

The Messages:
Poor examples
I have tried most of the examples of "good practice" on this page - sadly, I gave up waiting with all of them.

Maybe it's the servers, or maybe I have some firewall that blocking these particular apps (though I don't think so); in either case, it doesn't bode particularly well for using these as the basis for moving forward.

Anonymous person anon
London, UK

Tue Mar 02 12:59:36 GMT 2004
Dear anon...
You are an idiot.

The links work fine. Please don't confuse
your technical problems with the quality or content of this article.

Me
UK

Tue Mar 02 14:20:04 GMT 2004
On Layout Managers
In my layout courses I've found that developer can work much better with TableLayout than GridBagLayout or SpringLayout. It seems to me that the difference is in the costs to build a mental layout from a layout specification.

I've put all my findings together in the JGoodies FormLayout and the JGoodies Forms layout system. It's free and open source, comes with many examples and can do things you can't do with SpringLayout (out-of-the-box) or GridBagLayout or TableLayout.

http://forms.dev.java.net/

Hope this helps.
Karsten

Karsten Lentzsch karsten@javagoodies.com
Kiel

Thu Mar 04 11:00:50 GMT 2004
You're right
I agree with you, and I think any developper who remember the time of beginning of Flash and Applets also.

I agree also on the fact that Swing should improve its toolkit of cool component and layouts.

Problem is why nobody (other company or open source) succeed doing already those 'add-in' to Swing ? Why should it be always sun that has 'everything to do when it's about java' ?

They are already focusing on making opengl, xawt,swing, java2d, etc ... and you ask them to do also the cool ide that run what you want in 2 clicks. I think it's too much for the same company (that don't even sell those as products).

Maybe ask Macromedia to recode it's Flash Mx implementation in java ... (that was also an advantage of applet at the beginning as there was no support of mac and unix for flash at beginning)


P.Jourdan
France

Thu Mar 04 13:57:54 GMT 2004
Lots of good points
You make lots of excellent points.

I often write little Java utilties for myself. However, writing front-ends should be easy - not take twice the time it took to write the utility itself!

I really believe that the next two years are going to be crunch time for Java GUIs. Java has proved itself on the server side, but not on the client side.

BTW, I went to a Java Tech Day in London recently and saw a very funky XML-based Java IDE and applet: http://www.marttech.com

David david_lewis_bates@hotmail.com
Cheltenham, UK

Thu Mar 04 14:50:11 GMT 2004
the sad thing..
The sad thing is that it still takes me much less time to build a GUI using MS Visual C++ and MFC than it does w/ Swing.. and the results are better.
Time is money...

dog dog@dog.com
Paraguay

Thu Mar 04 17:32:14 GMT 2004
JXTable
You want a JTable with mixed-size fonts and automatic sorting?

My free library, Glazed Lists that makes it easy to that.
http://glazedlists.dev.java.net/

Jesse Wilson jesse@swank.ca
Ontario, Canada

Thu Mar 04 17:32:45 GMT 2004
maybe what we need
Other posters here have inspired me. I think what we need is some Jakarta like open source project for Swing enhancements. Maybe there is one already?
dog dog@dog.com
Paraguay

Thu Mar 04 17:37:41 GMT 2004
JXTable or Glazed Lists should support multi-column sorting
It's the primary reason we turned to Infragistics' (formerly known as Protoview) JSuite. Their JPVTableView (http://www.infragistics.com/products/tablesgrids.asp) supports up to three columns sorting, searching, printing?almost everything that JTable should have been born with plus a highly configurable look and feel (3D effects, shadows, flexible header row?). Unfortunately it?s not open source.
I am not sure if Glazed Lists support multi-column sorting; I couldn't tell by looking at the demo.
If I ever think about writing my own, then JPVTableView would be a good starting point.
Thanks.

AK appmath@yahoo.com
Phoenix, AZ, US

Thu Mar 04 21:38:37 GMT 2004
swing can be anything
Hi! I agree totally with that. Swing needs to be marketed. What i know from Swing is that everything is possible. Everything you talk about is in fact allowed by swing and Java2D. But who wants or has time to do it? Unfortunately (or not) the customers I work with dont really care if their powerful secured management database connected tool is beautiful or not. Because it is not the priority. Of course I like to deliver something that looks nice and I care about user experience. With good practises and thanks to jgoodies and other lookandfeels this can be achieved relatively well in a professional manner. Swing applications are still in the B2B/E market and will fall soon in a wider market - i guess - once applications will make use of more advanced swing lookandfeels where application models are well defined, and layout description is totally separated (eventually using flash).
Kamal El Bedraoui kamal@nic.fi
Finland

Thu Mar 04 21:49:31 GMT 2004
I think Sun is pretty much ignoring Swing not just applets
Just look at The Swing Connection. Has not been updated in 5 months. "News" sites that have no "news" in 5 months means that there is no commitment to the product. In their wisdom they don't get what this article is all about (IMHO).

Just look at the Solaris GUI. I think that Sun's GUI standards are so incredibly low that they dont know how far off base/behind they really are.


J Carlson carlsonjf@hotmail.com
NE , USA

Fri Mar 05 16:01:17 GMT 2004
One idea might be to create a more simplified wrapper to swing & java2d that uses better defaults (like the antialiasing you mentioned), and perhaps implmented in jython or groovy.

It would make coding up interfaces much much simpler.

See JES for an example that uses jython to wrap JMF and other multimedia stuff:
http://coweb.cc.gatech.edu/mediaComp-plan/94

Anonymous person

Fri Mar 05 17:03:25 GMT 2004
Flash with Java
It seems to me that Macromedia is the closest to make a tool for easy & flexible UI design -- they just need to connect Flash with Java and provide developers with the easy use of Java objects in a Flash movie.
Branko

Mon Mar 08 04:48:21 GMT 2004
Flash is not the enemy
When you eliminate all the fancy effects, fades, wipes and animation from the so-called 'best practice' Flash UI's, you are left with very very basic applications. Flash isn't really a good vehicle for creating sophisticated data capture/manipulation interfaces. Its UI seems to be only a couple of steps on from HTML forms (and possibly not as powerful as XForms!?!)

I think applets are a thing of the past. The concept of downloading mini-applications embedded inside a web page has been around since 1996, but failed to gain anything but a tiny handful of converts. Even Macromedia themselves see the future as being outside of the web browser...

http://news.com.com/2100-1012-5167812.html

Java has moved on since the days of applets. Its real threat comes from stuff like the MS 'Visual' tools, not from Flash. Flash poses no more of a threat to Java and Swing than it does to Visual C++ and MFC/.Net. Swing isn't perfect, sure, and it needs to continue to mature - but not by being turned into a knock-off Flash clone.

Java and Flash are aimed at two entirely different types of user, with two entirely different ways of working, and two entirely different end goals. Java's destiny (in so far as it has one) is not to replace Flash as a means of creating web apps inside a browser - but to replace C++ as a means of writing software like the Flash plugin (and development tools) and web browsers themselves!!

Joe
England

Mon Mar 08 16:42:08 GMT 2004
Sun needs to wake up
I would love to see Sun step up and improve Swing and Applets. The cost of using Applets is too great at this time and the ability to communicate to the DOM is less than weak. It would be great to able to use Swing components separately within an HTML page like have multiple Applets on a page or I think as you stated in your article Applet Layers. But that communication from the component to the DOM has to be there. I also think that the Swing components should be Vector and the default look and feel should be replaceable as easy as implementing a template. I think DHTML never has given us what it promised because of many things one being greed of the Browser manufactories. They only want you to use there Browser so there is no incentive for them to embrace standards, which put us in this situation of needing Swing or Flash. If you have to support more then one Browser and need something better than what is available in HTML Swing or Flash is the answer. I hope Sun wakes up and rises to the challenge.
David Simmons david.simmons@fmr.com

Thu Apr 08 15:46:59 BST 2004
Check out Flex
http://www.macromedia.com/go/flexapp_store Slick

http://www.macromedia.com/flex/samples/explorer/explorer.mxml?versionChecked=true Nice way to have a quick look at how mxml works.


Dino Fancellu
UK

Thu Apr 08 16:40:53 BST 2004
One good thing about SWT ...
... it is causing Sun to get their act together. The other good thing is that you can't tell that the app is written in Java.
Anonymous person

Sat May 08 03:10:13 BST 2004
JXTable
I created Jeppers (http://jeppers.sf.net http://sf.net/projects/jeppers). It still needs some work to compare to some of the commerical offerings but it has cell spanning (multi-row and/or multi-column cells) and can apply individual styles to cells. I am not currently active on the project due to lack of interest. But I originally hoped to host bunch of Swing components. Please email me if you are interested in helping with this project.
Cameron Zemek grom358@yahoo.com.au
Queensland, Australia

Fri Oct 08 02:58:01 BST 2004
Check out Laszlo
Like flex, but open source, even has Eclipse based IDE (Nice, I've used it). Very professional, used to cost lots of money.

http://www.laszlosystems.com/

Dino Fancellu
UK

Wed Dec 22 12:42:27 GMT 2004
Solution for Swing problems
I agree with your comments but honestly I didn't like some of them.

The reason is Sun gives you the complete SOURCE CODE to everything within Swing. If you don't like it 'use the source Luke'. :-)

I've written a framework that combines a JFrame, Toolbar, status bar and makes it very simple to code with. You can find it here: https://tframe.dev.java.net/

I think the best phrase that I've heard of Sun's API and I honestly feel it fits.
Sorry I can't remember who to give credit for this but it goes something like...
"Sun has Computer SCIENTISTS who have written API code for software architects to work with unlike other API written by developers for people who just want to get it done."

I've used every major GUI API including Delphi, VB, VC++/MFC and Powerbuilder. They all have their own issues but NONE OF THEM gave me all the source to view nor made it so easy to work around any problem.

The beauty of Swing in my honest opinion is it WORKS on every OS. There will always be small issues as long as companies like MS want their OS to be an island that no one is allowed on or off with out paying tribute to Redmond.

I think if you honestly consider the enormous effort that it takes to have C code within the JVM that works with Mac, Windows, OS/2, Linux and other OS platforms you have to agree they've done 99% of the work.

The rest is open for us to use and capitalize on.
Thankfully Sun shares source code an allows OTHER companies to profit from their technology.

How many companies out there would put all of their chips in the .Net market? :-)

BTW
The author of C# is a personal hero because his Turbo Pascal is what I learned to code on.

I'm not afraid of MS developers but their legal team and managers can keep me up at night sometimes.

Sincerely,
Ed Tidwell

Ed Tidwell ed-tidwell@nc.rr.com
Raleigh, NC, USA

Sat Jan 29 22:35:12 GMT 2005
I completely agree
All those are good points. Swing's layout managers are horrible. It should not be that hard to make a good-looking Swing form. It should _not_ be necessary to use multiple nested panels with different layout managers to achieve good effects. That's like the old days of nested tables as layout in HTML. Horrible. The layout manager should do the layout without needing a lot of nested panels.

JavaUser

Sat Apr 30 07:42:53 BST 2005
JXTable
A great++ summary of what's missing to get the Swing client better to the desktop.
Point 4, the missing JXTable is wasting most of my time. Reading the groups it seems that there are uncountable hours wasted for developers not having enough time to become a JTable guru.
I know that there are some projects and commercial table beans around. But they all don't have enough power to solve this demanding task (IMHO).

Anonymous person

Wed May 04 15:10:12 BST 2005
JXTable
I thought I was on the right track to improve my JTable. But now I've read the NetBeans discussion how to make it work (http://openide.netbeans.org/proposals/property-infrastructure.html). They introduce a wrapper class for the cell editors and derive the JTable to work around all the shortcomings. The loosely coupled table to renderers/editors model is fine for a foundation but not usable out-of-the-box.
Unfortunatly for me is that the NetBeans solution shows that a lot of critical areas have to be addressed (focus and keyboard handling, painting, L&F/UI specifica and container iteration).
A JXTable is needed to solve these issues as well.

MeToo

Thu Jul 07 09:57:36 BST 2005
Its Already available
http://www.jidesoft.com/

I don't work for them or have nay reason to promote them other than the fact that there product looks like the answer to swing failings.

We need an open source equivalent to JIDE.

Mark mark@mohc.co.uk
DORSET, UK

Tue Aug 30 14:48:50 BST 2005
about documentation
Hi guys,
I thing a good documentation for gui design is something missing in java platform;
I read many books of C.Petzold about windows form programming, and I also read his book about C# programming in windows: the level of productivity the reader can achieve is impressive!(asp.net for example is not so simple to approach only 'cause of lack of killer documentation, even if the underlying technology is the same).
I think java swing - and possibly many other java related technologies - needs primarily a really good book first; of course I agree about drawbacks of current swing technology, and its complexity, but I think documentation should come first.
Thanks and greatings, Michele Nardelli

Michele Nardelli mnardelli@crema.unimi.it
Italy, Italy

Fri Sep 23 13:06:13 BST 2005
Doubt in java swing
Pls help me 2 solve this one.
I'm doing a project in Java swing.It has 3 modules in it.Each module displays a frame.when I run the program,the frame opening is exactly the same I've designed.But when I click a button to move to the next window,the components in that window disappears.again when I move the former window the components gets misplaced & disappears.Each time I take the mouse Pointer near the component it appears.I dint use any mouse event.I used only Actionevent & actionListener for the buttons.Pls kindly help me to overcome this problem.

rama rama_13984@yahoo.co.in
chennai, India

Mon Oct 03 18:51:40 BST 2005
if you like flash then use it
if you are a programmer use java... if you like flashy things then use flash
Anonymous person

Sun Nov 06 14:30:54 GMT 2005
new functionalities required!
Sun should provide more number of good (XP style) look and feels in the Swing API.

e.g.
The process of creating a new thread in action listner for a lengthy operation can be automated by defining an overloaded method in JComponent. e.g addActionListener([action listener], boolean isSeparateThreadRequired)

this will automate the process of spawning a new thread in the above said case.

Arvinder S Channey [ aschanney@yahoo.com ]
Hyd, India

Sat Dec 24 20:57:19 GMT 2005
new functionalities required!


e.g.

The process of creating a new thread in action listner for a lengthy operation can be automated by defining an overloaded method in JComponent. e.g addActionListener([action listener], boolean isSeparateThreadRequired)

this will automate the process of spawning a new thread in the above said case.

Sun should also provide more number of good (XP style) look and feels in the Swing API.

Arvinder S Channey [ aschanney@yahoo.com ]
Hyd, India

Sat Dec 24 20:59:46 GMT 2005
super
your example is super
karthick it_karthick2005@yahoo.co.in
channai, india

Wed Mar 22 10:28:34 GMT 2006
Proper Grammar
It is annoying to be distracted by glaring grammatical errors when they are repeated throughout an article such as this, making it difficult to focus on the content. Company names, like Sun, are collective nouns and therefore are referred to in the singular.

For example, "Sun have taken great strides..." is a bit jarring to read, as the proper (and expected) form is, "Sun has taken great strides..."

I have seen this disturbing trend spreading across many recent articles on the Web. Please refrain from propagating it, and instead, serve to set a professional example for other writers to follow (and I'll forgive you for using an "s" in place of a "z" in words like "organization", since you're in the UK - at least I assume you are, for that reason).

If needed, please refer to:
http://grammar.ccc.commnet.edu/grammar/plurals.htm

Bill
Silicon Valley, USA

Fri Apr 14 22:59:06 BST 2006
It is annoying to be distracted by glaring nobheads who feels the need to add nothing but act the prissy missy. And I don't think he needs your forgivess Willma.
Anonymous person

Fri Apr 21 11:19:58 BST 2006
OK, grammar?
Talking about takeing attention away from the subject - WTFO! That's military grammar for you :)
Dave djrup@yahoo.com
East Side, US

Mon Jun 19 20:16:04 BST 2006
The beginnings of this are underway
I think the people making the most headway in this arena are swinglabs.org and l2f components:

http://swinglabs.org
http://www.l2fprod.com

Swing is my favorite GUI framework from a development standpoint - I've never been able to get used to writing apps with anything else (and I tried very hard to like Flex mxml...) But you're absolutely right, we need more polished interfaces, animations, and glitz right out of the box.

The Swing developer that impresses me the most is Romain Guy:

http://jroller.com/page/gfx/Archives

A lot of the demos he writes seem to cater to your critiques exactly, for example:

http://jroller.com/page/gfx/20050709#a_music_shelf_in_java2d


Ismail Degani deganii@gmail.com
New York, USA

Sun Sep 17 02:33:05 BST 2006
Swing mouse pointer not shown
In my GUI the line when we split a window in two that place mouse pointer show like "-->|" this is correct but in same window i choose any of node in JTree this same time this mouse pointer "-->|" not showing it show normal mouse Pinter. But when drag it work correctly booth time.Why this icon not showing.

kalaivanan kalaivanan.vaithilingma@wipro.com
Bangalore, India

Fri Dec 01 13:46:50 GMT 2006
Compare Swing components and ActiveX
You should compare swing and ActiveX components. After all not ActiveX components are supported by browsers.
I have developement exp. in java swing on Windows,linux,mac machines. Didn't find Swing heavy or RAM consuming on any one.
'Developement time' is the biggest problem for Swing.
Macromedia have bought Flex and I am working on it too. I am using Eclipse. Flex doesn't have
database support. You need to use XML for that or JSP,ASP which outputs XML.
I don't think anyone uses Flash for MDI,SDI applications.

Deshpande
India

Thu Dec 21 12:56:23 GMT 2006
Is this the answer?
Java FX:
h t t p :/ / preview. tinyurl . c o m /2saxyj

Marc marc@-r-e-m-o-v-e-sitdown.org.uk
UK

Wed May 09 11:11:28 BST 2007
Managed Hosting, Colocation and Data Center Services by victoryushchenkonashpresudent ...
Robert robert@fret.uk
USA

Sat Jul 28 02:43:19 BST 2007
why should i go to Drag & Drop in swing
i want to know,why should we go to darg and drop in swing?...

in other words,what are the advantages and disadvantages of using drag and drop operation in swing?

what is the purpose of drag&drop?

please tell....

karthik karthikkumar.karu@gmail.com
bangalore, india

Thu Dec 27 09:05:25 GMT 2007
why should i go to Drag & Drop in swing
i want to know,why should we go to darg and drop in swing?...

in other words,what are the advantages and disadvantages of using drag and drop operation in swing?

what is the purpose of drag&drop?

please tell....

karthik karthikkumar.karu@gmail.com
bangalore, india

Thu Dec 27 09:09:09 GMT 2007
problem with java
i m new for java.i have been alloted a project in java.i have to make a tutorial in java.can anyone suggest me how to split the screen in 2 so that left part has a picture and right is having some text.
prajakta deshpande prajakt.deshpande23@gmail.com
jaipur, india

Mon Feb 18 10:43:25 GMT 2008
Why Swing is struggling
Swing is overly flexible for one thing. This is to let developer add customization but has the side effect of added complexity. Many IT managers don't understand Swing or rich client programming for that matter is an art. Very little books devoted to the subject. But they are few very good ones out there if one care to look. Swing has been given an unfair reputation. Many Swing developers are compensated unfairly. I don't want to generalize but there are so many JEE developers out there. If you compare the complexity and architecture of JEE vs Swing. Swing is a far more sophisticated piece of programming. I myself enjoying using Swing. I'd like to see Swing continue to thrive or at least survive (sigh)...
SwingFan SwingFan@microsoft.com

Thu Jun 19 20:28:36 BST 2008
Why Swing is struggling
Swing is overly flexible for one thing. This is to let developer add customization but has the side effect of added complexity. Many IT managers don't understand Swing or rich client programming for that matter is an art. Very little books devoted to the subject. But they are few very good ones out there if one care to look. Swing has been given an unfair reputation. Many Swing developers are compensated unfairly. I don't want to generalize but there are so many JEE developers out there. If you compare the complexity and architecture of JEE vs Swing. Swing is a far more sophisticated piece of programming. I myself enjoying using Swing. I'd like to see Swing continue to thrive or at least survive (sigh)...
SwingFan SwingFan@microsoft.com

Thu Jun 19 20:28:36 BST 2008
different types
fvfb
val 9a9a9a9@gmail.com
TX, USA

Tue Jun 02 14:27:23 BST 2009

Post a new message


 

Thinly Disguised Money-Spinning Department



Related Articles

NetBeans Survival Guide / NB 3.6 User Interface Revamped

Software Fashion

The Inmates are Running the Asylum


<< Back to Soapbox

<< Back to the Front Page


All trademarks and copyrights on this page are owned by their respective owners.
Stories and articles are owned by the original author.
All the rest Copyright © 1998-2008 Matt Stephens. ALL RIGHTS RESERVED.