Slashdot Mirror


SWT, Swing, or AWT - Which Is Right For You?

An anonymous reader writes "Why is there more than one Java GUI tool kit? The best answer is that one size does not fit all, nor is there a one-size-fits-all GUI tool kit to be invented soon. Each tool kit offers advantages and disadvantages that make selecting one more appropriate, given your needs and intended audience. Read descriptions of each tool kit's basic features, and the pros and cons of using each."

323 comments

  1. SWT AWT Swing by Anonymous Coward · · Score: 0, Funny

    Fuck off, I hate you all

    Sincerely, GTK

    1. Re:SWT AWT Swing by hlge · · Score: 1

      But I have a GTK look and feel now Sincerly, SWING

  2. I like native widgets by BadAnalogyGuy · · Score: 1

    I offer apologies for not naming the widget set I like best. Let's just call it UnderConstruction.

    1. Re:I like native widgets by kaffiene · · Score: 1

      SWT *is* native widgets, you dork

  3. site down by Anonymous Coward · · Score: 0

    so there's no story, really.

  4. Whats the point of a story... by Anonymous Coward · · Score: 0

    When the server is "under maintenance". Why not delay the story for 5 hours or whatnot?

  5. Bussinessmodel? by Anonymous Coward · · Score: 0

    1: Make free software.
    2: Take a poo.
    3: ?
    4: Profit!

    1. Re:Bussinessmodel? by Anonymous Coward · · Score: 0

      More like

      1. Take a poo
      2. Call it free software
      3. ?
      4. Glory!

    2. Re:Bussinessmodel? by Hal_Porter · · Score: 1

      At least if someone gives you an open source poo, you can demand a copy of the food they ate to produce it.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  6. Google Cache by ReverendRyan · · Score: 2, Informative
    1. Re:Google Cache by qbwiz · · Score: 1

      Did you just insult IBM?

      --
      Ewige Blumenkraft.
    2. Re:Google Cache by ChunderDownunder · · Score: 1
      Not given that at the time of posting the URL advises
      The IBM developerWorks Web site is currently under maintenance.
  7. System.Windows.Forms by fyrie · · Score: 2

    I'm lovin' it!

    1. Re:System.Windows.Forms by ocelotbob · · Score: 1

      Tell me why I, using my Linux box, or using my Mac, should love features of a proprietary patent-encumbered language? Clock's ticking.

      --

      Marxism is the opiate of dumbasses

    2. Re:System.Windows.Forms by CaptnMArk · · Score: 1

      Gtk# is better.

    3. Re:System.Windows.Forms by Overly+Critical+Guy · · Score: 1

      My NIB files are laughing at you.

      --
      "Sufferin' succotash."
    4. Re:System.Windows.Forms by TheWanderingHermit · · Score: 1

      Because you might be a developer who writes programs that other people use, instead of just toys for your own system. And some of those users just might need a cross platform language and GUI. Or you might have to develop in Java for a number of reasons.

    5. Re:System.Windows.Forms by Anonymous Coward · · Score: 0

      Amen! WPF is coming soon too :)

    6. Re:System.Windows.Forms by ocelotbob · · Score: 1

      I think you're a bit confused here, or I was unclear. I was responding to a poster who was asking about system.windows.forms, not SWT or Swing. Java's GUI features are useful, I was trying to glean insight as to how a silly feature of a silly by and large windows-only programming language would be useful.

      --

      Marxism is the opiate of dumbasses

    7. Re:System.Windows.Forms by daliman · · Score: 1

      If you read your GP, the post makes more sense. They weren't attacking the java sets, they were attacking windows.forms; which is not, last time I looked, particularly cross platform...

    8. Re:System.Windows.Forms by kingkade · · Score: 2, Informative

      Java programmer here. There is a Free project called Mono which is implementing most of .NET, even the non-standard WinForms is also emulated and they are offering alternatives with other GUI toolkits like Gtk#. Mono targets many platforms. Again, I'm a Java programmer and even I know this. I think diversity's good. Competition's good. What do you think the main driver is behind JSF? Yep, .NET's WebForms.

    9. Re:System.Windows.Forms by Anonymous Coward · · Score: 1, Interesting

      Then you'd probably like SWT. It falls to the least common denominator: Windows forms.
      I don't know why anyone actually enjoys programming winforms. Do you like writing resize functions? Then changing them all the time?

      Personally I'd take gtk over about any other toolkit. But of the ones in this article Swing is clearly the strong winner. The only thing I find horribly lacking in it is actually the listener mechanism. Having one function handle every event for an object is just messy when it comes down to it.

      But, since Java doesn't support function pointers or multiple inheritance, implementing an action listener is about all you can do. And to do that, you have to only have a finite number of functions to make the user implement.

      And for those obsessed with toolkit mechanisms from 1987, Swing supports a "null" layout manager, so you can just put crap wherever via pixel positions.

      And, you might wanna realize that Microsoft is coming halfway to the modern world with WPF. They now support a dynamic resizing system, based on a tabular form for your widgets. They line up with each other, and are pulled to things. I guess gpu's are fast enough to calculate a spinning rubix cube with a different video on every side, but heaven forbid you write a real layout system ;).

      And hence, you'll have resizing apps at the cost of almost no performance, and little learning. But unfortunately some of the widgets may look _really_ STUPID when you make the window very tall.
      The point: Kiss winforms goodbye, you're about to get halfway to a real UI toolkit!

      Maybe next they'll come halfway to a real HIG!

    10. Re:System.Windows.Forms by ocelotbob · · Score: 1

      I know about mono and they themselves say that certain pieces of Windows.Forms are patent-encumbered and require workarounds. Why would a developer want to put himself at risk for patent litigation when there are other cross-platform solutions that work just as well and don't rely on methods that are in a legal grey area?

      --

      Marxism is the opiate of dumbasses

    11. Re:System.Windows.Forms by DrXym · · Score: 1
      Windows.Forms at least for 1.1 is pretty wretched. What makes it nice to use is the visual designer in .NET. Since it has no layout manager and the designer is so straightforward, it is easy enough to slap a form together. It's only when you start playing around with it in detail that you realise it is very much tied to the Win32 platform.

      I understand .NET 2.0 has layout managers but I haven't spent any time playing around with them yet. I know from experience of Java IDEs that it could hardly do a worse job than they do of trying to visually design a form with a layout manager installed. I consider the VE plugin for Eclipse to be a fairly good form designer but even that can be hellishly confusing especially if you flip from one layout model to another.

    12. Re:System.Windows.Forms by Anonymous Coward · · Score: 0

      I'm a mono developer. I'd appreciate a list of said patents.

      Oh? You have no clue what these hypothetical patents are? what a shock...

    13. Re:System.Windows.Forms by DrXym · · Score: 1

      GTK# could be better but it isn't better until such time as it becomes as easy as or easier to design a form using GTK# on Win32 as it is to design one with Windows.Forms. That certainly implies writing wizards and plugins that integrate into DevStudio to provide equivalent support for the alternative widget set. Until that day arrives, NO ONE using .NET on Windows is going to pay the slightest bit of attention to it.

    14. Re:System.Windows.Forms by kingkade · · Score: 1

      Patent-encumbered? Care to cite a reference? FUD, plain and simple; sounding like a robot, echoing the groupthink. It'd seem sad if it weren't so scary.

      WinForms was not submitted as a standard .NET API, that's true.

      SWT provides a wrapper around native Win32 APIs also, does that make it "patent-encumbered"? Now if you mentioned that some of the older .NET APIs used long Handles or just seemed Windows-centric in some way then I'd have some respect for your argument. In fact boredom is the only thing keeping me amusing myself like this originally trying to find some useful information from you but that ship has sailed. Later.

    15. Re:System.Windows.Forms by killjoe · · Score: 1

      Would you use it in a production environment? Me neither.

      --
      evil is as evil does
    16. Re:System.Windows.Forms by killjoe · · Score: 1

      MS has hinted at various "intellectual property" around the .NET platform. They have flat out said that they intend to vigorously defend their intellectual property (both gates and ballmer have said it). When asked outright whether they intend to hold the mono project harmless from patent litigation they have refused to give them blanket immunity.

      So no specific patents but a penumbra of eminations from the top brass MS hints at things that may happen in mono ever becomes a threat to MS.

      Right now it's just a somewhat compliant .NET implementation which will soon catch up with the oldest .NET implementation from MS. By the time vista comes out mono will be so far behind it will be a joke.

      --
      evil is as evil does
    17. Re:System.Windows.Forms by jma05 · · Score: 1

      System.Windows.Forms is not a language.

    18. Re:System.Windows.Forms by Trejkaz · · Score: 1

      They said "features of".

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
    19. Re:System.Windows.Forms by kingkade · · Score: 1

      Like I said: WinForms may have a bit of platform-specific code that may be depended on but there are no patents. which is the whole point. MS hinting and not giving "blanket immunity" is not unusual. Look at Sun and the JCP. If you're interested, go here for info about what Mono is: http://www.mono-project.com/FAQ:_General

    20. Re:System.Windows.Forms by kingkade · · Score: 1

      Would you use it in a production environment? Me neither.

      That's great. Answering you're own question, I mean. I guess you don't need me.

    21. Re:System.Windows.Forms by perkr · · Score: 2, Informative

      Try netbeans 5, they have Mantisse, a GUI builder that handles layout managers in a straight-forward way. I didn't really believe the hype about it first, but a friend of mine very new to Swing managed to build a non-trivial UI that scales very well upon resize using nothing but it.

    22. Re:System.Windows.Forms by ocelotbob · · Score: 1

      If there are no patents involved in winforms, then why does Mono's own page on licensing say there are patent issues involved with Winforms?

      --

      Marxism is the opiate of dumbasses

    23. Re:System.Windows.Forms by sbrown123 · · Score: 2, Informative

      Yeah, Mono is a nice project. Theres is also a Java .NET framework that can be used with it (IKVM).

    24. Re:System.Windows.Forms by msobkow · · Score: 1

      I think you're giving .NET WebForms way too much credit.

      Take a look at fundamental Java JFC and the contract interfaces it defines. Now take a look at web interface programming and JSF. I think you'll realize rather quickly that JSF is nothing more than a webcentric API for implementing the JFC contracts.

      WebForms is the response to a little Apache project called "Struts". JSF builds on their concepts as well.

      Add Java 5 annotations, stir, shake well, and deliver. It's a very nice 1.0.

      --
      I do not fail; I succeed at finding out what does not work.
    25. Re:System.Windows.Forms by Anonymous Coward · · Score: 0

      even the non-standard WinForms is also emulated


      Well, it implements an old version, partially, and often badly. I don't really think WinForms is a viable cross-platform choice right now.
    26. Re:System.Windows.Forms by hey! · · Score: 1

      Well, forms design is one of those things that looks like a mountain from one side but a molehill from the other, the dividing line being knowing the toolkit well enough to handle all the details you need to get something working.

      From a learning perspective I'd say GTK# is simpler to learn, and Windows forms gets with wizards and painters gets you to something you can show a few hours faster. What really matters in the long run is maintenance. Good programmers are careful to sever relationships between bits of program that are not truly essentially connected, so I'd guess that the good ones do well with either choice.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    27. Re:System.Windows.Forms by hey! · · Score: 1

      Do you like writing resize functions?

      Is there something about this task that prevents a programmer from abstracting it? I always follow the rule of three: the thrird time I do something it goes in a library.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    28. Re:System.Windows.Forms by Billly+Gates · · Score: 1

      Funny I thought System.Windows.Forms is not available in Linux?

      Fine just use gtk+? Well the users wont have it installed on their system. oops

      I have not seen any programs that are cross platforms. Not even hello World programs that are written in c#. As far as I am concerned its proprietary

    29. Re:System.Windows.Forms by Haeleth · · Score: 1

      MS has hinted at various "intellectual property" around the .NET platform. They have flat out said that they intend to vigorously defend their intellectual property (both gates and ballmer have said it). When asked outright whether they intend to hold the mono project harmless from patent litigation they have refused to give them blanket immunity.

      Funny how logic goes out of the window when a zealot looks at MS.

      MS are going to defend their IP vigorously.
      To sit back and let someone infringe your IP would not be defending it vigorously.
      Therefore, MS will sue anyone they discover infringing their IP.

      Right? Well, I'm sure you can see where I'm going with this...

      MS will sue anyone who infringes their IP.
      MS has not sued Mono.
      Therefore, Mono does not infringe MS IP, QED.

    30. Re:System.Windows.Forms by DrXym · · Score: 1
      These are all good points but the reality is that GTK# won't have any mindshare or eyeballs while it is perceived rightly or wrongly to be hard to use than Windows.Forms. It takes a few minutes to produce a form in DevStudio, moves some buttons around, build and test it.

      GTK# has no integration at all with DevStudio so you must create a console based .NET app, start changing the references, write the code to initialise / terminate GTK#, fire up Glade, screw around with its just plain weird interface, pop back to DevStudio, test and build. That's even assuming you could be bothered doing all that. I suspect it would be a very hard sell to management to justify wasting so much time on GTK#.

      The same for the rest of the so-called alternative application stack in Mono. I'm sure it is better in certain ways but immediacy isn't one of them. It might leave a bitter taste in certain develop's mouths but they have got to embrace and extend DevStudio if they expect to make any dent on Microsoft at all. If the alternate stack were served up to MS Developers, including any advantages that GTK# or whatever offered. Cross-platform support is an obvious benefit but I fear that most people assume that .NET is cross platform anyway and that Mono perfectly implements Windows.Forms to begin with.

    31. Re:System.Windows.Forms by CableModemSniper · · Score: 1

      "Hello world" in C# will definitely run under Mono or .NET without recompilation. Its not very useful I grant you but that I can attest does work. Did work in fact, over a year ago.

      --
      Why not fork?
    32. Re:System.Windows.Forms by kingkade · · Score: 1

      Dont' be misleading:

      The core of the .NET Framework, and what has been patented by Microsoft falls under the ECMA/ISO submission (emphasis mine)

      There are worries specifically about WinForms (and other parts of the API) in the same way the Java TM is patented by Sun. Is there any difference?

    33. Re:System.Windows.Forms by kingkade · · Score: 1

      WebForms is the response to a little Apache project called "Struts". JSF builds on their concepts as well.

      WebForms was not inspired by Struts. Ridiculous, they are so totally and completely different approached that I have to guess you've used neither or possibly one or the other. But JSP is also inspired by Struts, that part is true IMO.

    34. Re:System.Windows.Forms by CaptnMArk · · Score: 1

      You are right. Many windows (MS) toolkits are designed not for use by programmers, but by wizard users.

      That's why .net/Mono is a waste of time for linux programmers.

      The Wine-based Windows.Forms implementaion is especially a waste of time for linux users (maybe not for windows/wine users).

    35. Re:System.Windows.Forms by OldAndSlow · · Score: 1

      Submission to a standards organization does not open a patent. Some organizations will not accept a technology as a standard if it is patent encumbered. I don't believe that to be the case with ECMA. Note that they didn't submit to IEEE or ANSI.

    36. Re:System.Windows.Forms by killjoe · · Score: 1

      Well would you?

      --
      evil is as evil does
    37. Re:System.Windows.Forms by killjoe · · Score: 1

      Obviously MS isn't going to sue everybody who infringes their IP. They didn't sue Apple even though they patented the clickwheel after the ipod came out.

      So obviously they are going to pick their targets selectively. They will go after mono if mono presents a threat. Obviously mono can not threaten them until its compliant and from the pace of things it will never catch up to MS development.

      --
      evil is as evil does
    38. Re:System.Windows.Forms by killjoe · · Score: 1

      If there are probably patents, and if MS has not given them blanket immunity then I would say there is a real threat of patent litigation there.

      --
      evil is as evil does
    39. Re:System.Windows.Forms by bar-agent · · Score: 2

      Have you actually abstracted resize functions into a library? That'd be a sight to see.

      The reason no one does that is that all layouts are different, with different things that need to be resized or not, under different conditions. Like, if my window gets too small, this thing needs to be collapsed entirely. Or, as a window gets bigger, another thing only needs to be resized up to a point, then it is more useful to put the extra space somewhere else.

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
    40. Re:System.Windows.Forms by edwinolson · · Score: 1

      doesn't it nearly incite you to violence that you can call any widget methods from arbitrary threads? It drives me crazy. (Or has this been fixed?)

    41. Re:System.Windows.Forms by aCapitalist · · Score: 1

      You are right. Many windows (MS) toolkits are designed not for use by programmers, but by wizard users.

      Windows programmers are wizards? That's a nice compliment

      That's why .net/Mono is a waste of time for linux programmers.

      Oops, but you don't get to decide that. Too bad for you.

      The Wine-based Windows.Forms implementaion is especially a waste of time for linux users (maybe not for windows/wine users).

      You sure are knowledgeable about Mono. The wine-based winforms implementation has been for a while now.

    42. Re:System.Windows.Forms by ultranova · · Score: 1

      You are right. Many windows (MS) toolkits are designed not for use by programmers, but by wizard users.

      Well, that makes sense. Every time there's an inconsistency, a wizard did it ;).

      The Wine-based Windows.Forms implementaion is especially a waste of time for linux users (maybe not for windows/wine users).

      Wine in general is a waste of time, since no nontrivial program works under it. None ever will, either, since the development concentrates on implementing theming support, graphical configuration utilities, and other such irrelevant crap, instead of actually trying to make those programs work.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    43. Re:System.Windows.Forms by fatphil · · Score: 1

      Hmmm...

      """
      United States Patent Application 20030028685
      Kind Code A1
      Smith, Adam W. ; et al. February 6, 2003

      Application program interface for network software platform

      Abstract

      An application program interface (API) provides a set of functions for application developers who build Web applications on Microsoft Corporation's .NET.TM. platform. ...

      [0061] A windows forms namespace 322 ("System.Windows.Forms") containing classes for creating Windows.RTM.-based client applications that take full advantage of the rich user interface features available in the Microsoft Windows.RTM. operating system, such as the ability to drag and drop screen elements. ...
      """

      --
      Also FatPhil on SoylentNews, id 863
    44. Re:System.Windows.Forms by Anonymous Coward · · Score: 0

      I agree. The thing that bugged me about awt and swing (I used both a good deal) was that they were buggy, leaked memory, and were horrible performers. You can argue superiority of them them over .NET but consider this: there was a huge window before .NET came out in which everyone was very tired of MFC and the like. People were itching for something better. Why didn't Swing take over? You can't say it was an evil Microsoft plot because Java was hot and people were dying to use it. Sun had every opportunity to take over the desktop ui. I saw multiple companies and projects try and most backed out. Those that did not were disappointed at the end results. At the end of the day, like or not, most people are doing forms for desktop apps. No its not perfect but it is clean, object orientated, pleasurable to use, and it pays the bills.

    45. Re:System.Windows.Forms by hey! · · Score: 1


      The reason no one does that is that all layouts are different, with different things that need to be resized or not, under different conditions.


      That's true, but you don't have to solve the general case. Just the ones your app uses most commonly.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  8. Is none of the above an option? by killjoe · · Score: 4, Insightful

    You don't have to go with those, there are java bindings for everything!> QT, wxWindows, even curses!.

    Pick the one you like!

    --
    evil is as evil does
    1. Re:Is none of the above an option? by penguin-collective · · Score: 4, Funny

      Yeah, trouble is, no matter which you pick, you'll still be programming from Java.

    2. Re:Is none of the above an option? by ultranova · · Score: 3, Informative

      You don't have to go with those, there are java bindings for everything!> QT, wxWindows, even curses!.

      Pick the one you like!

      Pick something besides AWT/Swing, and your users need to download and install it. That lessens the chances that they pick your program, or that they will even be able to pick it - after all, every third-party library needed decreases the chances that all of them have been ported to the target platform.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    3. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      Well it could be worse, you could be targetting the CLR!

    4. Re:Is none of the above an option? by StarfishOne · · Score: 1

      Perhaps you could try Jython. :)

    5. Re:Is none of the above an option? by killjoe · · Score: 1

      They need to download a JRE anyway so what's the big deal.

      --
      evil is as evil does
    6. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      Or maybe Jash... :P

    7. Re:Is none of the above an option? by The+Infamous+Grimace · · Score: 1

      Pick something besides AWT/Swing, and your users need to download and install it. That lessens the chances that they pick your program, or that they will even be able to pick it - after all, every third-party library needed decreases the chances that all of them have been ported to the target platform.

      Bundle the necessary libraries with your app, and don't use libraries that require a separate download. It's all about the licensing.

      (tig)
      --
      Ignorance and prejudice and fear
      Walk hand in hand
    8. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      Sounds like a Despair, Inc. poster. LOL!

    9. Re:Is none of the above an option? by Billly+Gates · · Score: 1

      Which is why web developers tend to now avoid java and use activeX instead.

      I have seen mac web developers standardize on WMV instead of quicktime even though they can't view them on thier own system! Why? Because the user will go to a different site rather than download quicktime.

      IE is the standard and java is not included so its best not to use and stick with Microsoft based standards.

      And you wonder how MS is able to retain its monopoly?

    10. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      Use awt or swing and your users have to get along with a slow, strangely looking, awful interface which will turn them away from your application anyway.
      Therefor, use wx4j.

    11. Re:Is none of the above an option? by Anonymous Coward · · Score: 1, Interesting

      Pick something besides AWT/Swing, and your users need to download and install it.

      Or they just get screwed. AFAIK there's still no 64-bit version of SWT on Windows. If you want an SWT application to work on x64, you have to install the 32-bit JVM. :(

    12. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      SWT is over a MB in size, compressed. Bundling it with most Java applications dramatically increases the download size.

      Azureus currently takes 10MB of space on my system. 2MB of that is SWT. 20% of the entire application is the GUI toolkit!

      Since SWT requires a native component, you can't really install it as an addon to the existing JRE. This means every SWT application requires its own install of the SWT.

      Bundling the SWT with your application really isn't feasible when everyone using Java has Swing included.

    13. Re:Is none of the above an option? by Anonymous Coward · · Score: 0
      Since SWT requires a native component, you can't really install it as an addon to the existing JRE. This means every SWT application requires its own install of the SWT.
      This isn't really true. You can dump the SWT .JAR file in your JRE's lib/ext directory, and the native part somewhere in your %PATH%/$LD_LIBRARY_PATH, and all SWT apps will be able to share a single copy of SWT.

      Unfortunately, the Sun Java runtime uses an incredibly ass-backwards packaging scheme, so there's no good way for packagers to know exactly where the JRE's directory (and hence its lib/ext directory) is. On the Linux side of things, JPackage is going a long way towards cleaning this up -- so distros that use JPackage actually do package SWT as a shared library that all SWT apps use in common. AFAIK, there's no movement on the Windows side of things to fix this.

    14. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      For lightning fast and low memory situations why not use a light weight library such as thinlet or visualtrading. these libraries use under 60k offer everything that the megabytes of Swing use. They are fast and use XML for templating the layouts. visualtrading is very powerful and we've used it for prduction quality fixed income trading systems. Also lightweights typically use java 1.1 so they work with every default Java installation of browser and can often be used with j2me and other mobile variants.

    15. Re:Is none of the above an option? by ultranova · · Score: 1

      Bundle the necessary libraries with your app, and don't use libraries that require a separate download. It's all about the licensing.

      So, which version of SWT should I bundle - Windows, Linux, Mac ? I don't have Mac, so if I include Mac libraries, I'm shipping code I can't possibly test... Not good.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    16. Re:Is none of the above an option? by ultranova · · Score: 1

      Use awt or swing and your users have to get along with a slow, strangely looking, awful interface which will turn them away from your application anyway.

      Admittedly, a Swing application doesn't look like Windows application. Neither does Winamp. Never seemed to hinder it any... Swing doesn't seem to be particularly slow. Image scaling is hideously slow in Java, it appears to have something to do with direct pixel manipulation methods of BufferedImage class being slow. But Swing widgets themselves answer as fast/slow as any other widgets in my system.

      Coming to think of it, last time I saw it, Windows Media Player didn't look like a Windows app either - it didn't even have a rectangular window.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    17. Re:Is none of the above an option? by RedWizzard · · Score: 1
      SWT is over a MB in size, compressed. Bundling it with most Java applications dramatically increases the download size.
      Are you seriously trying to claim that an extra megabyte or two is a dramtic increase in the size of a software package? Have you looked at the size of software downloads lately? Acrobat Reader is 20MB. iTunes/QuickTime is 33MB. The .Net runtime is 20MB. If people are downloading those then an extra 1-2MB isn't even going to be noticed.
    18. Re:Is none of the above an option? by angel'o'sphere · · Score: 1

      The same is true for me in the opposite direction.

      If a website has *.WMV files instead of *.MPEG its pretty likely that I don't bother to figure with which player its viewable and go away as well.

      BTW: every windows user I know has quicktime installed .... well, I only know about 30 or so ... probably not rpresentative.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    19. Re:Is none of the above an option? by Bronster · · Score: 1

      It comes packaged with iTunes, which means it's only going to get more installations as the iPod becomes the darling of the entire universe.

    20. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      Jobol is good enough for anyone.

    21. Re:Is none of the above an option? by kalirion · · Score: 1

      I don't know, in my experience it's pretty easy to tell when you're using a Swing app - there is no instant response when you pull down a menu. It can also be annoying(ly different) when you click a button and it stays clicked until whatever action it's supposed to perform is finished. This maybe because the Swing API requires that all action handler and GUI manipulation code happens in the same thread, though I'm sure there are plenty of ways to get around it.

    22. Re:Is none of the above an option? by ultranova · · Score: 1

      It can also be annoying(ly different) when you click a button and it stays clicked until whatever action it's supposed to perform is finished. This maybe because the Swing API requires that all action handler and GUI manipulation code happens in the same thread, though I'm sure there are plenty of ways to get around it.

      Of course, the most obvious being to have the button simply queue the work to a background thread (the interface "Executor" is good for this), and when the work is done, it can queue an update to the GUI with SwingUtilities.invokeLater(). That's what I've done in the program I'm developing, and it works perfectly.

      Just make sure that you don't use an unbounded thread pool, since then you might run out of memory.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    23. Re:Is none of the above an option? by Anonymous Coward · · Score: 0

      Yeah but soon a little up and coming language called Jackoff will have them all covered.

  9. Thin is IN by Heembo · · Score: 1

    The fastest and most furious (and most widely jvm comatible) are thin awt + a few thin third part libraries for complex widgets. Swing is to FAT for my taste!

    --
    Horns are really just a broken halo.
    1. Re:Thin is IN by LnxAddct · · Score: 1

      I recommend you download the Java 1.6.0 beta called Mustang. Swing is not only now multi-threaded and fast as hell, but it also takes on the native appearance perfectly regardless of your platform or theme.
      Regards,
      Steve

    2. Re:Thin is IN by jZnat · · Score: 1

      I'm using this too, and I can assure you that it still doesn't support Qt, so it still has a long way to go.

      --
      'Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
    3. Re:Thin is IN by Heembo · · Score: 1

      I recommend you download the Java 1.6.0 beta called Mustang.

      Thats tomorrow my friend. Lets talk about today. If I had to write a GUI applet, where I wanted thin (low download) and fast (fast GUI performance close to windoze) I would go with Java 1.5 AWT + 3rd party widgets such as those from Protoview. http://jdj.sys-con.com/read/35998.htm What you are suggesting about Mustang *might* work tomorrow, but I'm talking about real-world solutions for today!

      --
      Horns are really just a broken halo.
    4. Re:Thin is IN by aCapitalist · · Score: 1

      ...but it also takes on the native appearance perfectly regardless of your platform or theme.

      Haha, only if that was true. It's a nice try by Sun, but too little too late.

    5. Re:Thin is IN by LnxAddct · · Score: 1

      Under Linux (using GTK/Gnome), Mac OS X, and Windows, it all works fine. You can't tell it's not native. Care to share your experience and where it didn't work? Seriously, I'd like to know so I can make a note about it and possibly work around it if need be in the future.
      Regards,
      Steve

    6. Re:Thin is IN by aCapitalist · · Score: 1

      I've got Mustang b72 right now. I tend to download builds every month or so. Just take a look at Netbeans or IDEA on an LCD. Maybe the Netbeans and Intellij guys need to rework some of their code for the new subpixel fonts, but they don't look anything close to native. Everybody can tell it's not native, and will always be able to tell, because it's not native. Sun screwed up by insisting on painting everything themselves. Even if Mustang was on par with cleartype and native look-n-feel, it's too late in the game.

      Apple got their Swing implementation right. Sun should have taken notice years ago.

  10. Why is AWT even an option? by dood · · Score: 3, Insightful

    It should be SWT vs Swing. There's hardly a reason to use the plain AWT when there's Swing (a much more powerful library built on top of AWT).

    1. Re:Why is AWT even an option? by roman_mir · · Score: 2, Interesting

      Oh, really? No reason at all? About a year ago, I had to work on a project for Christie Digital through Alt Software. The project was about building software that controlled video input from multiple devices into the same computer (I tested with 70 simultaneous inputs, this was possible because the hardware used overhead busses from input cards to output cards,) and video output onto rear-projector TV Video Walls. The software had to be designed in a way that supported multiple different platforms (windows/linux/unix.) So the front end was written in Java - this piece handled the windows, channels and profiles, it handled all the user interface issues. In the middle there was cross-platform C++ for video thread handling and resource management, and the back-end was all platform specific C code (basically device drivers from different vendors.)

      So I did prototypes with Swing and found that there were problems with JNI Canvas handling. It wouldn't work properly but it did work with AWT. The Canvas had to be drawn in a specific color (magenta,) so that when the window handle was passed through JNI to C++, that code could pass the window handle further to the C drivers, that would draw on top of the magenta color within the window (on the Canvas.)

    2. Re:Why is AWT even an option? by BiggerIsBetter · · Score: 1

      Which begs the question, why not use a crossplatform GUI toolkit as well?

      --
      Forget thrust, drag, lift and weight. Airplanes fly because of money.
    3. Re:Why is AWT even an option? by DrSkwid · · Score: 2, Informative

      I'm sorry, I can't see your circular reasoning.

      Perhaps you meant "raises the question".

      http://en.wikipedia.org/wiki/Begging_the_question

      Surprising considering how often people get pulled up for this one on /. and your relatively low UID.

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    4. Re:Why is AWT even an option? by Anonymous Coward · · Score: 0

      From your very own Wikipedia link:

      Modern usage

      More recently, to beg the question has been used as a synonym for "to raise the question", or to indicate that "the question really ought to be addressed". For example, "This year's budget deficit is half a trillion dollars. This begs the question: how are we ever going to balance the budget?" This usage is often sharply criticized by proponents of the traditional meaning, but has nonetheless come into sufficiently widespread use that it is now the most common use of the term.

      Arguments over whether the newer usage should be considered incorrect are an example of debate over linguistic prescription and description.

    5. Re:Why is AWT even an option? by DrSkwid · · Score: 1

      *sigh*

      Another reason to stop using wikipedia.

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    6. Re:Why is AWT even an option? by Trejkaz · · Score: 1

      I don't think it's okay to use an excuse which amounts to saying "but heaps of other idiots do it".

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
    7. Re:Why is AWT even an option? by ChunderDownunder · · Score: 0, Offtopic

      Please stick to the topic at hand, namely Swing vs SWT.

      The link you supplied states that the parent's phrase is a modern usage and that
      "Arguments over whether the newer usage should be considered incorrect are an example of debate over linguistic prescription and description."

      Unless your doctorate is in linguistics, who are you to prescribe its usage?

    8. Re:Why is AWT even an option? by Anonymous Coward · · Score: 0

      Eat shit. 1,000,000,000 flies can't be wrong. Just because you are stupid doesn't mean everyone is.

    9. Re:Why is AWT even an option? by Smallpond · · Score: 1

      Did you look at SWT? Like AWT it uses peered native widgets instead of drawing everything itself like Swing. It sounds like some of the problem that you were having is that a Swing window looks empty to the window manager. All of the internal structure is hidden inside the Java code.

      I haven't tried SWT. It sounds like it takes some study to get started. Hopefully it is more compatible between Windows and X than AWT.

    10. Re:Why is AWT even an option? by roman_mir · · Score: 1

      I am a contractor, the business requirement was to use Java.

    11. Re:Why is AWT even an option? by nwbvt · · Score: 1

      Why is Swing an option? Its got to be the worst GUI tool kit ever. Unless of course you want to make ugly, slow, and bloated interfaces for your applications...

      --
      Mathematics is made of 50 percent formulas, 50 percent proofs, and 50 percent imagination.
    12. Re:Why is AWT even an option? by pjt33 · · Score: 1

      Not everyone uses J2SE. I did a project recently in J2ME (CDC/PP), and AWT was the obvious toolkit because it's in PP. I wanted the program to be as small as possible, which ruled out adding swingall.jar.

    13. Re:Why is AWT even an option? by hunterx11 · · Score: 1

      So what you're saying is that since alot of people say it irregardless, people shouldn't try to be precise in writing?

      --
      English is easier said than done.
    14. Re:Why is AWT even an option? by BiggerIsBetter · · Score: 1

      Fair enough, you gotta do what you gotta do.

      --
      Forget thrust, drag, lift and weight. Airplanes fly because of money.
    15. Re:Why is AWT even an option? by kiddygrinder · · Score: 1

      Language is democratic. That is why we have my proper nouns than just "Ug"

      --
      This is a joke. I am joking. Joke joke joke.
    16. Re:Why is AWT even an option? by Trejkaz · · Score: 1

      Sure, but that's different than using a blatantly wrong term for something.

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
    17. Re:Why is AWT even an option? by brpr · · Score: 1

      If you want to be precise, why do you say "irregardless"?

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    18. Re:Why is AWT even an option? by hunterx11 · · Score: 1

      Sometimes when I eat too many Irish children, it throws my grammar off a bit.

      --
      English is easier said than done.
  11. Ugh by Hellraisr · · Score: 0, Troll

    While we're at it, why don't we take a poll on who uses solid deoderant vs deoderant spray vs gel deoderant.

    Next topic: which linux distro do you use?

    1. Re:Ugh by Anonymous Coward · · Score: 0
      ...why don't we take a poll on who uses solid deoderant vs deoderant spray vs gel deoderant.

      Next topic: which linux distro do you use?

      There must be a word that would describe the mutually exclusive propositions of polling people who use deoderant versus polling people who have a favourite Linux distro.Maybe it's conceptually oxymoronic.

    2. Re:Ugh by lanswitch · · Score: 1

      Only when they make a deodorant by the name of "Conceptually Oxymooronic" I'd consider using some.

    3. Re:Ugh by narcc · · Score: 1

      What about roll-on? You insensitive clod!

    4. Re:Ugh by Anonymous Coward · · Score: 0

      This is Slashdot you're talking about! What the heck IS deoderant?!

    5. Re:Ugh by Anonymous Coward · · Score: 0

      I won't need to be reminded to stay upwind of you! I am sure your odor will precede you.

    6. Re:Ugh by DrSkwid · · Score: 1

      To paraphrase Tesla :

      If you thought a bit more, you wouldn't have to sweat so much.

      Deoderants are for the dirty +)

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    7. Re:Ugh by Anonymous Coward · · Score: 0

      The skin is an organ and deodorants block the pores and prevent the skin from breathing.

  12. No Win64 SWT by Anonymous Coward · · Score: 1, Informative

    Since SWT is not available on Win64 it is Swing.

    1. Re:No Win64 SWT by Anonymous Coward · · Score: 0

      thats interesting, seeing as SWT is written in java, and java code is totally portable... http://www.eclipse.org/articles/Article-SWT-Design -1/SWT-Design-1.html

      Also. Who needs all these widgets anyway? I fly with System.out.print();

    2. Re:No Win64 SWT by randyjg2 · · Score: 1

      Actually no, there is a binary component to SWT because it wraps native widgets. When you download the libraries, you have to download the SWT library appropriate for your platform. 64 bit support for windows is (sorta) under development See bug 57151 for the remaining issues

      https://bugs.eclipse.org/bugs/show_bug.cgi?id=5715 1

    3. Re:No Win64 SWT by srmq · · Score: 1

      Yeah, the 5 people that use Win64 should stay with Swing.

  13. My six word summary by MillionthMonkey · · Score: 2, Interesting

    SWT : buy
    Swing: hold
    AWT : sell

    1. Re:My six word summary by krilli · · Score: 1

      Be sure to pick up some of that MillionthMonkey stock as well, as he is currently performing rather well.

      --
      Jag pratar lite svenska.
    2. Re:My six word summary by Smallpond · · Score: 1
      AWT: short
  14. Huh? by Yaztromo · · Score: 5, Informative
    Why is there more than one Java GUI tool kit? The best answer is that one size does not fit all

    That hardly answers the original question -- it's true, but it doesn't answer the statement in question. That would be like saying:

    Why is the sky blue? The best answer is that 1 + 1 = 2

    The reason why there are three toolkits is simply: originally, Sun developed AWT. AWT was introduced with Java 1.0 as a way to obsfucate the drawing of common GUI widgets on a variety of platforms, using the native widget set. Unfortunately, this was problematic for many platforms, and wasn't very flexible.

    Thus, Sun developed Swing. It supported more widgets, and did a lot of its own drawing in order to appear and generally layout the same across different platforms.

    Swing, unfortunately, has some design limitations, not the least of which is that it is very memory hungry. When IBM decided to "port" VisualAge for Java from being a Smalltalk-based product over to using Java, they found that Swing wasn't up to the task, so they decided to develop their own widget toolkit, called SWT. SWT wasn't exactly intended for use outside Eclipse, mind you -- it's just that many developers decided to use it as such.

    So we're left with a bit of a GUI mess on our hands in the Java world -- one I really wish would be fixed. Swing works, but it can be slow and memory intensive. SWT is non-standard, and requires a platform-specific module which users may not already have installed (which means either you have to tell them to download and install it, or you have to create a bunch of installers for different platforms to allow them to run your SWT-based application).

    That is why we have thre different toolkits. For all intents and purposes, the bulk of AWT is deprecated and shouldn't be used for its widgets. It is simply difficult to get rid of due to the number of legacy applications out there which are still using it, and which will probably never be updated to use Swing.

    And then there is Cocoa-Java...

    Yaz.

    1. Re:Huh? by Iffy+Bonzoolie · · Score: 1
      AWT was introduced with Java 1.0 as a way to obsfucate the drawing of common GUI widgets on a variety of platforms, using the native widget set.
      I think you mean abstract the native widgets for a set of platforms, not obfuscate.

      -If
      --
      Run a pencil-and-paper RPG campaign with your far-off friends: Gametable!
    2. Re:Huh? by Solra+Bizna · · Score: 1

      Ever write an AWT program?

      -:sigma.SB

      --
      WARN
      THERE IS ANOTHER SYSTEM
    3. Re:Huh? by Iffy+Bonzoolie · · Score: 1

      Yes. I agree, it sucks. But, the phrasing of that particular jibe just didn't really make sense as it stood. I really didn't know if he was trying to make a point, or was just using the wrong word.

      -If

      --
      Run a pencil-and-paper RPG campaign with your far-off friends: Gametable!
    4. Re:Huh? by Yaztromo · · Score: 1
      think you mean abstract the native widgets for a set of platforms, not obfuscate.

      You are, of course, quite correct. It has just been one of those days, I suppose :P.

      Yaz.

    5. Re:Huh? by Lobais · · Score: 1

      I don't think it is fair to use the swing memory argument anymore. It is really something that has been worked on.

      Personally my experience with swing is that it is very logical and easy. Only problem is that being written directly in java, it doesn't fit into many desktops. The new ocean theme is much better than the metal one, but it still looks very wrong in, lets say, a gnome desktop.

    6. Re:Huh? by pdoubleya · · Score: 1

      Just one correction: Swing was based in (large) part on Netscape's Internet Foundation Classes, which were Netscape's attempt to have a cross-platform GUI component set. Sun and Netscape worked out some deal and Sun took this over, and re-worked and re-branded it as the Java Foundation Classes. See the Wikipedia article here. Cheers! Patrick

      --
      "I honestly would vote libertarian if their candidates weren't usually total cooks."--slashdot poster
    7. Re:Huh? by jez9999 · · Score: 1

      Honest question - what do you mean by saying that SWT is 'nonstandard'?

    8. Re:Huh? by Yaztromo · · Score: 2, Informative
      Honest question - what do you mean by saying that SWT is 'nonstandard'?

      It's not part of the Java standard from Sun. That isn't to say that SWT itself doesn't conform to its own defacto SWT standard -- it's just not part of the Java standard. It is my understanding that legally, IBM can't advertise SWT as being "Java", and can't even technically call Eclipse a Java IDE (even though it does the job just fine).

      Sun needs to take a look at what Apple has done with Interface Builder and Cocoa. It should then replicate a similar system in Java for designing and describing Java GUIs. Now that Java 1.5 has java.beans.XMLEncoder available, this should be significantly easier for them to accomplish.

      GUI development in Java is still painful and problematic. Which is too bad, as I'm actually a proponent of Java on the desktop (although IMO only Apple has got this right, with their JAR Bundler tool, such that you can distribute a Java application to users such that it appears to them to be just like any other application -- they never have to be even be aware that it's a Java application).

      Yaz.

    9. Re:Huh? by tjansen · · Score: 1

      I have never heard of anyone who did not use Swing because of its memory usage. Most people have a very simple problem with Swing: GUIs created with Swing are ugly and do not look professional. People use AWT because AWT apps look much better.

    10. Re:Huh? by TheParanoidOne · · Score: 1

      There is a GTK look and feel ...

    11. Re:Huh? by Yaztromo · · Score: 5, Informative
      I don't think it is fair to use the swing memory argument anymore. It is really something that has been worked on.

      I agree that there have been improvements, but I'm sorry -- I do think it's fair to continue to take Sun to task for this still.

      A quick example -- the jSyncManager, my most popular OSS application. It can be run in either GUI or console mode. In both, the engine code is identical -- only the user interface differs. Firing it up in GUI mode uses about 35MB of RAM on my Mac OS X 10.4.5 based PowerBook. Firing it up in console mode uses ~15MB of memory.

      That's a 20MB difference, and that is just after start-up. The GUI has a single window, with three menus, and a total of 11 menu items. There are NO widgets in the window -- instead it just has a graphic (it's meant to be run minimized -- the menus allow access to help, configuration items, and the log window). And yet that uses 20MB.

      Activating every menu item that bring up a GUI dialog once, with the exception of the Help subsystem (which uses JavaHelp) brings it up to ~45MB of memory usage. Bringing up everything including JavaHelp once causes it to use ~55MB of memory. That is 40MB of GUI, and it is all absolutely trivial stuff -- excluding JavaHelp, it's probably less than 50 widgets all together.

      True -- I have 1.25GB of RAM in my system, so 40MB is barely even noticed. Still, this is an absolutely trivial GUI (the complexity is in the data synchronization engine -- again, this application is meant to be a "fire-and-forget", run it in the background program which handles PalmOS data synchronization, and doesn't typically require any user input other than configuration).

      For a more complex comparison, I fired up "Tapear", a clinical document management system that is part of another Open Source project I work on known as OpenTAPAS. It has only one window, but has hundreds of widgets of all types in it, with multiple tabs for a whole variety of different view types. It doesn't have much of anything in terms of an "engine", as it retreives all of its data from a remote database. After loading it up and opening up a single patient, it uses 80MB of RAM -- more than even my entire IDE (Xcode) uses by 25MB.

      (I should note that all the above tests were done with the latest release version of Java 1.5 for Mac OS X (PPC)).

      One more example -- Limewire 4.9 uses ~75MB of RAM with no transfers.

      Sorry, but Swing is still quite memory hungry. Can you imagine running all of your applications as Java applications? Improvements are being made, but I think there is room for further improvements in this regard.

      Yaz.

    12. Re:Huh? by Yaztromo · · Score: 2, Insightful
      I have never heard of anyone who did not use Swing because of its memory usage.

      Are you new around here? ;)

      Admittedly, I use Swing. I don't avoid it because of its memory requirements, but they are a source of continued concern to me. Admittedly, the issue doesn't get as much attention these days as RAM continues to become ever more inexpensive, but there is still serious room for improvement. Read my other posting here on this subject for some examples.

      Swing is flexible, and can create some nice GUIs. I don't like how much coding this requires (as I've mentioned elsewhere in this thread, Sun really needs to look at how Apple has solved the GUI design issue with Interface Builder, where instead of trying to create source code that has to be compiled to generate your UI, it gets serialized at design time, and deserialized at runtime (which has the added benefit that you can modify your GUI without the need for a recompile)), and I really don't like how quickly Swing can chew up RAM. Yes, I have a gig and a quarter of RAM, but no, I'm not in a hurry to fill it up as quickly as I possibly can either. I have yet to see a single platform where Swing wasn't a memory hog.

      Yaz.

    13. Re:Huh? by tjansen · · Score: 1

      Actually I am not that new, that's why I am wondering. I didnt do any Java GUI development in the last few years, but I remember using Swing for medium-size apps in the late 90s, on computers with 128 MB RAM. RAM was never an issue.
      The L&F was a huge issue though, so bad that we considered using Microsoft's (Windows-only) Java GUI and I eventually created my own toolkit on top of AWT.

    14. Re:Huh? by asuffield · · Score: 1

      Swing, unfortunately, has some design limitations, not the least of which is that it is very memory hungry.

      I'm surprised that you didn't mention the biggest problem with Swing for practical purposes, which is that the API was designed by an insane crack weasel with a terminal case of brain rot. Really, what sort of person thinks that getSystemLookAndFeelClassName is a sensible name for a function in a standard library? (There's certainly far worse issues, but that one always struck me as the most gratuitous. Somebody probably spent a fair bit of time thinking of the most obnoxious names they could for the more obscure functions - you just can't come up with a name like that by accident)

      Swing makes the rest of the java standard library look good.

    15. Re:Huh? by Malc · · Score: 1

      I would argue that Swing doesn't work. One of the big problems that Java has always had is that although it tries hard, it always fails to look and feel like a native app. It's frustrating for end users, who often decide you've written a second-rate app because it doesn't feel right.

    16. Re:Huh? by swillden · · Score: 1, Informative

      Firing it up in GUI mode uses about 35MB of RAM on my Mac OS X 10.4.5 based PowerBook. Firing it up in console mode uses ~15MB of memory. That's a 20MB difference, and that is just after start-up. The GUI has a single window, with three menus, and a total of 11 menu items.

      I doubt that it really uses 20MB. It just appears to use 20MB. What's almost certainly really happening is that it's mapping 20MB more of virtual memory, of which very little is actually used. For example, if the program needs a class or two from some JAR, the JVM will mmap() the entire JAR file, reserving virtual address space for all of it, even though only the pages that actually get read will be faulted in and consume real RAM. So several megabytes of virtual address space has been "consumed", but only a few KB of actual RAM is used.

      I'm not trying to say that Swing doesn't use too much memory... just that its unlikely that your measurements are even remotely accurate. Probably the best way to get a realistic measurement is to have your system running as little software as possible, disable swap to keep that from clouding things, then add up your free RAM plus the RAM used for disk caching to get your total "free" space estimate. Then start your app and record the new total of free RAM plus cache. Do this several times and if the numbers aren't all over the place you'll probably be able to use the difference between the app-running and app not-running states as an estimate of memory usage.

      Getting reliable app memory usage estimates out of systems with reasonably modern virtual memory systems is really hard. Even this approach tends to overestimate the real usage, becuse in order to avoid to much randomness you have to shut down every app possible. But in normal use, many of the libraries and files used by the app you're trying to get an estimate for will be shared by other applications, so a really accurate estimate should divide the cost of those items among the apps in some reasonable way.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    17. Re:Huh? by Smallpond · · Score: 1

      What about JFrame, JRootPane, glasspane, layeredPane and contentPane == severeHeadPane.

    18. Re:Huh? by beru777 · · Score: 1

      AWT is not and can't be deprecated because Swing is built on it.

      About the memory hungriness, Java is like that, whether you use SWT or Swing or anything else... I just opened Limewire (swing) and Azureus (SWT)... They both use about 45 Mb...

    19. Re:Huh? by mellon · · Score: 1

      My main problem with swing is that you have to exhaustively test swing code on every platform and VM where you expect it to run, and you will likely run into weird behaviours. I don't know why this is so, but that's been my experience. I think if you are developing for a single platform it's probably fine, but the mere fact that the APIs are the same on all platforms unfortunately does not mean that it behaves the same, so the whole cross-platform story was a sad joke for me, and I wound up dropping it. I'm now programming with Qt and C++, and happy as a clam.

    20. Re:Huh? by henni16 · · Score: 1

      One more example -- Limewire 4.9 uses ~75MB of RAM with no transfers.

      With Limewire one has (or had, it must have been a 1.x or 2.x version) another memory problem:
      the number of shared files.
      I once set an entire 20GB partition with probably between 5000 to 10000 files to "shared" and my computer was forced to its knees by Limewire using x-hundreds MB ofmemory.
      My guess is that Limewire created a Java File object and a somewhat costly metadata/info/stats objects for each file it found. Also, every file had to be indexed&stuff for search queries.

    21. Re:Huh? by mad.frog · · Score: 1

      Really, what sort of person thinks that getSystemLookAndFeelClassName is a sensible name for a function in a standard library?

      I don't get your point.

      I don't know Swing (thus, I don't know how frequently this method is called), but this seems not-unreasonable to me for something infrequently used. It's a bit on the long side, but so what?

      Would you perhaps prefer something like "sysLookClsNm()" ?

    22. Re:Huh? by lscoughlin · · Score: 1

      Netbeans Matisse project is pretty much exactly what you're talking about -- it's all like "ooh ooh, i want to be interface builder!!!"

      You're right though, about the tookits. The reason why no one likes java gui development is because all of the libraries are pretty bad. AWT is way to light, Swing is not well- anything ( engineered or otherwise ), and SWT, while sort of interesting, is basically a hack to build eclipse.

      There are a lot of well engineered tookits out there, with sensical API's. SUN should take some time and study both QT and SWF( .net gui api ) and do it right, rather then continuing to try to "fix" swing.

      --
      Old truckers never die, they just get a new peterbilt
    23. Re:Huh? by angel'o'sphere · · Score: 1

      The reason why no one likes java gui development is because all of the libraries are pretty bad. AWT is way to light, Swing is not well- anything ( engineered or otherwise ), and SWT, while sort of interesting, is basically a hack to build eclipse.

      I can't believe that ;D

      Swing and QT share the same design principles, why is one in your eyes bad and the other one in your eyes good?

      SWF on .NET? Thats a cross compiler from C# to "Macromedia FLash", what the hell can that be good for anything? Except of integrating existing Flash code of course.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    24. Re:Huh? by angel'o'sphere · · Score: 1


      'm surprised that you didn't mention the biggest problem with Swing for practical purposes, which is that the API was designed by an insane crack weasel with a terminal case of brain rot.

      First of all: I like to challange your ability to design somethign complex. If you claim Swing is bad designed hen I claim, you don't udnerstand Swing and ergo you follow its bad desigend.
      Please enumerate 2 or 3 issues whre you find the design od Swing lacking, and pelase give an advice how you had designed it better.


        Really, what sort of person thinks that getSystemLookAndFeelClassName is a sensible name for a function in a standard library?


      After all every IDE uses intelli sense to expand method names while you write your code. Writing you do once. So a long mehtod name should not be a problem. So: what is your problem with that method name?

      If you read code where this method is used, the method name is pretty descriptive, so again: how would you call the method? After all the coe is read likely often and also by different people and most of all even by people who don't know this particular subset of the Swing API you use. So isn't it good for them that they exactly know what the method does without the need of a comment or to look up the API docs?

      Further, as a application developer you should not have any need to call that method anyway.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    25. Re:Huh? by Abcd1234 · · Score: 2, Informative

      I doubt that it really uses 20MB. It just appears to use 20MB. What's almost certainly really happening is that it's mapping 20MB more of virtual memory, of which very little is actually used. For example, if the program needs a class or two from some JAR, the JVM will mmap() the entire JAR file, reserving virtual address space for all of it, even though only the pages that actually get read will be faulted in and consume real RAM. So several megabytes of virtual address space has been "consumed", but only a few KB of actual RAM is used

      And just to further this point, modern JVMs will, if the OS allows it (like, say, Linux), mark unused pages as free for use by the OS. So, the JVM may allocate a very large hunk of memory, then, through garbage collection, free up a bunch of that memory and then release the pages back to the OS. However, process monitoring tools may not properly reflect this, and simply display the peak amount of memory the JVM has requested.

    26. Re:Huh? by BigGerman · · Score: 1

      Just FYI, this is likely to be called exactly once, even before any GUI is init'ed so it is perfectly fine. OP does not know what he is talking about.

    27. Re:Huh? by texwtf · · Score: 1
      Good thing java has garbage collection unlike those lesser languages! That sure helps keep memory usage low!

      Things I !@$!@$!$@!@ hate about java: $CLASSPATH. It's slow. Memory Frigging Pig. Jsp (hint: slow, memory pig). Zealots who point to benchmarks to point out how fast it is. It's not. It's slow, go ask your users. Oh, you quadrupled your memory and CPU and now it seems almost snappy? Good job.

      How about another couple abstraction layers? Maybe that will hurry things up.

      Yeah, I'm sure I sound like a troll. But really, it's just from my own humble experiences with the language.

    28. Re:Huh? by Anonymous Coward · · Score: 0

      All of this is interesting, but it's worthless without a comparison to another GUI toolkit. Java is very memory-hungry, so this sort of thing doesn't surprise me. Provide an alternate implementation and then we'll see if Swing really has a problem.

    29. Re:Huh? by Yaztromo · · Score: 2, Informative
      Things I !@$!@$!$@!@ hate about java: $CLASSPATH. It's slow. Memory Frigging Pig. Jsp (hint: slow, memory pig). Zealots who point to benchmarks to point out how fast it is. It's not. It's slow, go ask your users.

      I have asked my users, and they tend to be surprised at how fast the jSyncManager is. At one time it was measurably faster than Palm's own HotSync Manager for Windows -- nearly 50% faster in some tests. And the jSyncManager is 100% pure Java. And the parsing code for the protocol stacks and data types is pretty complex. We've had users running this code on old Pentium-class systems, and the execution speed is still on par with native solutions.

      So yes, I've asked my users, and they're typically surprised that Java can be so fast. The key is having a developer who knows how to optimize code, with a sound design. Doing a lot of the heavy lifting work yourself doesn't hurt either (i.e.: not relying on a lot of external frameworks), as does using as much parallelization as possible.

      Hav eyou tried Jake2, the pure Java version of Quake 2? I have no speed issues playing it on my 1.33Ghz PowerBook -- it works like a champ.

      Sorry, but Java speed complaints are mostly bunk. Swing does have some performance issues (although this can differ from platform to platform), but Java as a whole is quite fast. You simply have to have developers who know what they're doing when it comes to optimization and overall program design to make the most of it.

      Yaz.

    30. Re:Huh? by Yaztromo · · Score: 3, Informative
      I doubt that it really uses 20MB. It just appears to use 20MB. What's almost certainly really happening is that it's mapping 20MB more of virtual memory, of which very little is actually used. For example, if the program needs a class or two from some JAR, the JVM will mmap() the entire JAR file, reserving virtual address space for all of it, even though only the pages that actually get read will be faulted in and consume real RAM. So several megabytes of virtual address space has been "consumed", but only a few KB of actual RAM is used.

      I'm quite aware of how to properly profile memory for Java applications, and yes, there is a 20MB difference in actively used memory. The virtual memory claimed is siginificantly higher than what I quoted -- where it's using ~35MB of real memory, the process is claiming a whopping 453MB of virtual memory (which of course isn't allocated at all, and thus doesn't really affect much of anything performance or RAM wise). Opening all four possible dialogs at once bumps that memory usage up to closer to 50MB.

      I have a pile of Java memory profiling tools that all agree with this memory usage assessment. Now it's possible that the low level implementation on Mac OS X is more hungry than on some other platforms, but in my testing this is relatively equivalent to running it on Linux and Windows.

      Sorry, but Swing is memory hungry. It tends to show in complex applications, which is one reason why I've kept the jSyncManager as simple as possible in terms of GUI.

      Yaz.

    31. Re:Huh? by swillden · · Score: 1

      I'm quite aware of how to properly profile memory for Java applications

      How do you do it, then? I haven't found a good way.

      Sorry, but Swing is memory hungry.

      I didn't say it wasn't.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    32. Re:Huh? by kalirion · · Score: 2, Insightful

      Why do people keep bringing up Jake2 when talking about Java's speeds, only to say that they're running it on a machine that's faster than anything from Quake2 days? What would be really telling is how well Jake2 runs on a 300MHz Pentium 2 with a Voodoo2 or a TNT graphics card.

  15. None of them are very good by Anonymous Coward · · Score: 1, Insightful

    I would rather use a web front end than use any one of the three (and I have used them). Java on the client is too cumbersome and support intensive and the majority of users do not like them. Throw a nice dhtml front end at them and they are much happier (at least in my experience).

    1. Re:None of them are very good by jinxidoru · · Score: 1

      I agree that many things that are done in Java need not be done in Java. Flash is actually the most common offender in this category. Unfortunately, DHTML cannot handle anything and everything. Any client application which needs to do intensive processing is not going to be able to be written in DHTML. Of course, you can just make the web-application do everything for you, but why make your servers work so hard when your client has so many free CPU clicks?

    2. Re:None of them are very good by hookedin · · Score: 1

      I agree, at least for the appearance. Each time I have a reason to use Swing or SWT, I end up wishing that either of them would just render HTML. For one thing, there are decent WYSIWYG editors out there, which I've yet to find for Swing.

      In general, a markup language is easier to use than widgets. If I code a page manually I can do 90% or more of it without looking anything up, but with Swing I frequently have to consult a reference to figure out which widget to use and all of the methods and properties needed to get it to behave the way I want.

    3. Re:None of them are very good by stony3k · · Score: 1

      You might want to try the new visual Swing editor in Netbeans 5.0. I know, everyone uses Eclipse (even though it doesn't support half the things Netbeans does). The new visual editor really rocks.

      --
      Freedom is not worth having if it does not include the freedom to make mistakes. - Mahatma Gandhi
    4. Re:None of them are very good by Anonymous Coward · · Score: 0
      I agree that many things that are done in Java need not be done in Java. Flash is actually the most common offender in this category.


      Huh? Flash == Java?

    5. Re:None of them are very good by hibiki_r · · Score: 1

      JFormDesigner rocks. Very cheap, supports JGoodiesForms out of the box,and does both code generation and dynamic GUI loading using XML, depending on your preferences.

    6. Re:None of them are very good by jZnat · · Score: 1

      I think he might be referring to the usage of J2EE (server-side usually) instead of J2SE (client-side). If you run something like Geronimo with a nice HTML front-end, the user is that much happier.

      --
      'Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
    7. Re:None of them are very good by jinxidoru · · Score: 1

      Huh? Flash == Java?

      Sorry, didn't explain myself well. I was referring to the fact that a lot of people use Java or Flash instead of DHTML in places where DHTML is far more appropriate. This is especially common in the case of Flash.

    8. Re:None of them are very good by charlieOReilly · · Score: 1

      Hardware concerns aside, shouldn't bulky processes such as business logic be placed at the controller level? And shouldn't the controller level be placed on the server instead of the client?

    9. Re:None of them are very good by mad.frog · · Score: 1

      A lot of people use Flash instead of DHTML because it's Flash is more uniform across multiple configurations than DHTML is -- the need to adjust for the quirks and bugs of different browsers goes away. (Assuming the users have Flash installed, that is.)

  16. Right for *YOU*? by devjj · · Score: 2, Insightful

    Shouldn't the question be "Which is right for your project?"

  17. As this is a typical Slashdot wankathon story.... by tonywestonuk · · Score: 5, Informative

    .... let me post two opposing sides of the swing vs swt debate:

    Swt is crap

    and

    Swing is crap

  18. Advantages and disadvantages? by kwerle · · Score: 5, Funny

    Each tool kit offers advantages and disadvantages that make selecting one more appropriate, given your needs and intended audience.

    Having used them, I'm pretty sure that each just has a different set of disadvantages.

    Spoiled after 15+ years of [NeXT|Open|GNU]Step/Cocoa, I guess.

    1. Re:Advantages and disadvantages? by Anonymous Coward · · Score: 0

      Spoiled after 15+ years of [NeXT|Open|GNU]Step/Cocoa, I guess.

      Yeah, as long as you don't mind your application only being usable by about 4% of computer users, Cocoa is a perfect API to develop to.

      If you want to write something that can be used by the majority of Linux, BSD, and Windows users, on the other hand, it starts to have certain very obvious disadvantages.

    2. Re:Advantages and disadvantages? by kwerle · · Score: 1

      Yeah, as long as you don't mind your application only being usable by about 4% of computer users, Cocoa is a perfect API to develop to.

      You're absolutely right. The thing that is most depressing to me is that even though *step/Cocoa has been around for nearly 20 years, nothing has managed to copy it (see below) - even though everything else seems to [me to] suck.

      If you want to write something that can be used by the majority of Linux, BSD, and Windows users, on the other hand, it starts to have certain very obvious disadvantages.

      While this statement is true, I could also qualify it by adding "can [but won't] be used by...". It's been my experience (some time ago, admittedly) that developing cross platform Java GUI apps is 2nd worse example of "write once, test everywhere"; the worst being HTML with css, javascript, or anything interesting in it at all.

      You also fail to mention that GNUstep is cross platform for the various *nix platforms. So if all I cared about was OSX & them, I could probably mostly develop to Cocoa. Note that I have not tried porting a cocoa app to GNUstep, so I don't know how bumpy the ride is.

  19. None of the above. by seebs · · Score: 4, Interesting

    Buoy is your friend. It's built on top of Swing, but it's actually sanely usable. I recommend it on the grounds that it is the only Java GUI toolkit I have ever used that did not leave me longing for the sweet embrace of death. Developing an application using Buoy is substantially less painful then stabbing yourself in the eye with a fork. In the world of Java GUI development, this is high praise indeed.

    Seriously, though. If you are doing GUI work in Java, but your actual goal is to get something else done, and you would like the GUI toolkit to take less than 80% of your development effort, use Buoy. It's not "dumbed down"; it's just SANE.

    --
    My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
    1. Re:None of the above. by shutdown+-p+now · · Score: 1

      I do not know, but a framework which does not even obey the standard Java naming conventions (just look at the package names) looks rather suspicious. Oh, and can we please stop this silly idea of prefixing class names with some letter? Sun cannot fix that in Swing because they need to keep it backwards-compatible, but no such new monstrosities should ever be created.

    2. Re:None of the above. by Anonymous Coward · · Score: 0

      You might want to try this: http://www.coderight.nl/ and look at SwingForms. It works for me.

    3. Re:None of the above. by boeps · · Score: 1

      I'm an experienced Java developer and I really don't see the benefit of Buoy framework over swing. Instead of praising Buoy in every way possible, can you perhaps enlighten me on its benefits?
      By the way, Buoy uses reflective method invocations to bind swing events to Buoy events. Swing = not fast, reflection in Java is dead slow, end result = ?

    4. Re:None of the above. by arnwald · · Score: 1

      +1 for parent.

      Buoy makes life easy.

      T.

      --
      My other sig is Funny.
    5. Re:None of the above. by cryptoluddite · · Score: 1

      Reflection in a modern JVM is about 1/2 speed of a normal call if you are using a cached Method instance. The JVM actually compiles Method objects into actual classes and dynamically loads them. Typically the invocation of a method is far less time than the body of the method and events happen less than say a hundred times a second anyway, so effectively there is no slowdown to using reflection this way in a graphics toolkit. It's a good choice to reduce the complexity of the API, especially given a more complicated but faster API that people can use if necessary.

    6. Re:None of the above. by angel'o'sphere · · Score: 1


      I do not know, but a framework which does not even obey the standard Java naming conventions (just look at the package names) looks rather suspicious.


      What are you talking aboutß

      I just checked it, and it follwos the standard Java naming conventions.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    7. Re:None of the above. by Illume · · Score: 2, Informative
      I agree that speed isn't an issue. But only few Java programmers understand Buoy code (from the "about" page) like

      button.addEventLink(CommandEvent.class, this, "buttonPressed");

      and every Java programmer should understand JavaBeans code like

      button.addActionListener(((ActionListener.class) EventHandler.create(ActionListener.class, this, "buttonPressed"));

      Let's assume that I'm not to lazy to write a helper function to get rid of the casts in the JavaBeans version. Why would I want to use the Buoy event classes? Should I mix Buoy and EventHandler code when I want to use the more powerful EventHandler.create() variants?
    8. Re:None of the above. by shutdown+-p+now · · Score: 1

      Convention is to use reversed domain names for third-party package names, to prevent name clashes, e.g. org.eclipse.swt. Here, the package name is just buoy.

    9. Re:None of the above. by angel'o'sphere · · Score: 1

      You are wrong.

      Thats not "the convention".

      Thats a suggestion for avoiding name clashes in package names. The convention is to write package names lower case, thats all. E.g. its completely meaningless, if there is no "buoy.org" internet address.

      E.g. instead of writing org.eclipse.swt the Eclipse project could in fact just use "swt." alone ... however there is a eclipse.org internet address, so it makes completely sense to start packages with "org.eclispe.swt".

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  20. For the indecisive, SwingWT by Lknight · · Score: 1

    Although in beta, the pure java LGPL'd SwingWT http://swingwt.sourceforge.net/ attempts to replicate the Swing API (and it's huge) using SWT code. You distribute your platform specific swt library with your build, make sure it's in the searchable path (./binlib for example) and you're good to go. The AWT api is replicated as well.

    1. Re:For the indecisive, SwingWT by mark-t · · Score: 1

      I've never seen any alternative toolkit that has implemented a working version of java.awt.geom.Area. SwingWT seems to be no exception.

    2. Re:For the indecisive, SwingWT by radarsat1 · · Score: 1

      I think it would make more sense the other way around:

      You program your GUI in SWT. For any platform where a native library exists, use that. Otherwise, use a swing implementation of SWT. Bingo, perfect cross-platform!

      Most people's arguments against SWT is that it requires native libraries, but this would remove that requirement while still leaving the native widgets option open.

  21. So even IBM can't handle the slashdotting... by Sinbios · · Score: 1

    Our apologies The IBM developerWorks Web site is currently under maintenance. Please try again later. Thank you.

    --
    Anyone can "stand up for what they believe", but it takes a very brave individual to change what they believe. - Loundry
    1. Re:So even IBM can't handle the slashdotting... by jZnat · · Score: 1

      That can't be good PR for their AIX servers...

      --
      'Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
  22. IBM slashdotted! by wfberg · · Score: 1

    Our apologies

    The IBM developerWorks Web site is currently under maintenance.
    Please try again later.

    Thank you.


    Hehe.

    --
    SCO employee? Check out the bounty
  23. Swing by Anonymous Coward · · Score: 4, Interesting

    I've never used SWT, but I have quite extensive experience in both AWT and Swing, as well as many other GUI toolkits, including two cross platform toolkits of my own for a commercial product that shall be anonymous in this post.

    In my opinion the Cocoa AppKit on OS X is perhaps the most elegant overall. The problem is that with Cocoa AppKit, the common things are extremely simple and easy to do, but the more uncommon things can be quite tricky. With Swing, the most common things are still simple, but take considerably more code than with Cocoa. But when you get to something more advanced where you want to get some custom behavior (maybe dealing with drag & drop on some custom widget, or perhaps you want to customize the selection model on a tree widget or somethign similar), then Swing suddenly becomes much easier to work with compared to the otherwise simple Cocoa.

    AWT isn't really an option over Swing in my opinion. It's there for historical reasons, and as the low-level API for Swing. Swing is built on top of AWT, after all.

    There are a couple of larger problems with Swing:

    1) Performance can suck if you don't know exactly what you're doing.
    2) Making it behave exactly like you want often requires you to know it quite well.
    3) It is quite large and complex, and can seem overwhelming to learn.

    The performance problem is actually the biggest reason Java is still perceived as being slow by many people who aren't familiar with it. Developers often shoot themselves in the foot with threading issues, and it makes Swing UI's seem slow and poorly responsive. Also, because of poor understanding of the more advanced layout managers, it's also not uncommon to see Swing based UI's that just... look sort-of wrong. They don't look like native apps. Not because of look & feel issues of the widgets, but because of margins and paddings around widgets being wrong. You have problems like buttons being too large, text areas being right up to the edge of the window, quick-hack looking layout of widgets in preferences-style windows that have a large number of widgets, and so on. You often also see things like the app not painting itself during window resize drags, default window icons, inconsistent font sizes, and so on. Many of these are simply caused by people not fully knowing the Swing API and not knowing how to do things properly. It's not that you can't do them right, it's that people don't know the tool thoroughly. In my opinion, this is directly caused by the API being overwhelmingly large for many developers. While it gives Swing its incredible flexibility, it also indirectly is the cause for many of its problems.

    Sun is tackling the performance problem from one end. They are working on accelerating a lot of the lower level graphics API (image drawing, primitive drawing, etc.) with OpenGL and DirectX. This helps a lot in many situations, but it doesn't help in the cases where people do 3 second tasks in a UI event callback method. Likewise, the ugly-UI problem is being helped by better IDE's (Matisse in Netbeans 5, for example) and by Java SE 6's (Mustang) better handling of system look and feels.

    Still, there's a long way to go. But Swing is getting better every day, and it's the standard choice that works on all platforms, and it IS possible to do excellent UI's with it even today. You just need to learn it well. My recommendation is to read the API reference until you know it by heart. Then study the Swing source code to see how things work under the hood.

    1. Re:Swing by samkass · · Score: 1

      Nice summary. Actually, SWT, Swing, and AWT aren't your only choices in Java, though. There are a lot of small toolkits out there that each have some fascinating features, such as using the 3D graphics accelerator, handling zooming or animation better, etc.

      The company I work for years ago branched one called "Jazz" (which has since been renamed Piccolo and mostly moved to C#: http://www.cs.umd.edu/hcil/jazz/ ) and basically developed our own Java graphics toolkit. This let us make the things that are important to use very, very fast (Yes, GUIs in Java can be extremely responsive) and give us control over our own bugs and glitches. I don't think it's unreasonable for people writing Java applications for a living to have an engineer or two reserved for just maintaining graphics issues, at which point having your own toolkit that tracks one of the major or minor ones on the market becomes feasible.

      One thing that starts to become a necessity for this sort of thing, though, is the ability to embed a component of a different toolkit inside your own for compatibility with everyone else in the world. In our toolkit, embedded Swing components are impossible to get 100% right (because Sun made some of the event system "private"-- even the getters) but not hard to get 98% right. SWT is much harder.

      --
      E pluribus unum
    2. Re:Swing by jZnat · · Score: 1

      Eep! Don't read the source code if you ever want to work on GNU Classpath or anything. Sun's licensing is a bit queer when it comes to the source code, so be careful if you want to remain "untainted"...

      --
      'Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
    3. Re:Swing by Anonymous Coward · · Score: 0

      But when you get to something more advanced where you want to get some custom behavior (maybe dealing with drag & drop on some custom widget, or perhaps you want to customize the selection model on a tree widget or somethign similar), then Swing suddenly becomes much easier to work with compared to the otherwise simple Cocoa.
      [...]
      There are a couple of larger problems with Swing:

      1) Performance can suck if you don't know exactly what you're doing.
      2) Making it behave exactly like you want often requires you to know it quite well.
      3) It is quite large and complex, and can seem overwhelming to learn.


      Swing is "much easier to work with" for advanced tasks, but "making it behave exactly like you want often requires you to know it quite well"? What seems to be happening here is that you took the time to learn the massive Swing API and the best practices for using it, so that even complex tasks are now easy to you. But when when you turned to Cocoa, its simplicity when doing common tasks deceived you into thinking that there was little to learn, so that when you had to do more customizations you tried to do it the Swing way.

      This is a common pitfall when learning a different framework, but it seems to have particularly disastrous effects for people with a Java background who try to use Cocoa. I recently worked on updating on a Cocoa application that was originally written by a Java programmer: by reading the source, you could really tell that the guy was thinking in Swing terms, which often made him fight the framework instead of using it. I went through the code literally replacing screenfuls of code with three or four lines, fixing bugs and adding features on the way.

      Of course, I'm not suggesting that your code has the same problems, but as a general rule, when switching to a different GUI toolkit, or to a different language (or both, as might often be the case) it's all too common to mix up "easy" with "familiar".

  24. From a Technical POV... by DimGeo · · Score: 1

    In SWT it is easy to make plugins, because the components can and do get GC'ed after you properly dispose() of them. In Swing, many components are immortal, i.e. (J)Dialogs and (J)Frames are particularly stubborn. They are kept in some AWT Vector's inside the innermost painting loop and never die (hint: Sun, what about using WeakReference-s where appropriate? I know, not always possible, may break apps, etc.). On the other hand, if you forget to dispose() some SWT component, you end up with lots of leaks in your app. If you want plugins, learn resource management, and use SWT. You can go with Swing as well, but be prepared to require a restarts when a plugin is updated, only you will have to make the classloading on your own. If you want to write portable, static GUIs for Java, Swing is the way to go, as it is much, much easier to use.

    1. Re:From a Technical POV... by ChunderDownunder · · Score: 1
      In SWT it is easy to make plugins, because the components can and do get GC'ed after you properly dispose() of them. In Swing, many components are immortal, i.e. (J)Dialogs and (J)Frames are particularly stubborn. They are kept in some AWT Vector's inside the innermost painting loop and never die

      Really? I thought that was the purpose of java.awt.Window's dispose(). If they are out of scope they should then get garbage collected.

    2. Re:From a Technical POV... by pjt33 · · Score: 1
      They are kept in some AWT Vector's inside the innermost painting loop and never die (hint: Sun, what about using WeakReference-s where appropriate?
      Do you usually keep a hard reference to your main window? I don't. I do, however, call dispose() on windows I've finished with.
    3. Re:From a Technical POV... by DimGeo · · Score: 1

      I think there were tests in my ex-company (my info is a bit old, since the 1.3 days) which showed that JDialogs are more or less immortal, even if you try to dispose() them... Anyway, I may be wrong, so point taken.

  25. Swing is maturing, SWT has growing pains by BortQ · · Score: 3, Interesting
    I give much credit to SWT for putting a fire under swing and forcing them to improve. The current Swing is much better then it was a few years ago. It can take some long years before a toolkit matures and best practices for its use come out. I feel like that is happening now with Swing. If some of the SwingLabs stuff gets put into the real pipe that would be lovely.

    SWT seems to be encountering some growing pains as it really starts to cover everything that a toolkit must. I wish them luck in pulling through even stronger (on all platforms please). SWT certainly has had a strong start.

    It seems like there are enough Java developers out there to support 2 GUI toolkits. I think in the long run this can only be good for Java as a whole. If people don't like one they can stick with Java and swap out the toolkit. If one eventually becomes "the one" then it will only be because the other pushed it to be the best it could.

    --

    A Multiplayer Strategy Game for Mac OS X, Windows, and Linux
  26. Java is an unfinished language? by Futurepower(R) · · Score: 1

    MOD PARENT UP.

    In summary, the reason that there are SWT, Swing, and AWT is that Java is an unfinished language?

    My understanding is that Java is unfinished because Sun is holding it too tightly and yet has not provided sufficient support for finishing the language.

    1. Re:Java is an unfinished language? by eneville · · Score: 1

      I agree, the changes in 1.5 with lists and foreach prove 1.4 was not finished. I still like the language, stuff that doesnt use hardware too much is very portable, moreso than .net. Operator Overloading would be a nice addition though. That aside it's quite good.

  27. It's not just the toolkit, it's the tools by Anonymous Coward · · Score: 0
    If you want to build a GUI application, you need help. Yes you can do the entire thing with pure javax.* classes and emacs, and if you're very experienced with the tools, this is a perfectly fine way to go, but for less-experienced developers (ie, most of us) we need some help putting the app together. What I am suggestig is that which one you choose (SWT or Swing) is less important than having a good GUI builder tool. Swing without Matisse (NetBeans) is painful and tricky. Swing with Matisse is quite enjoyable to work with. I'm sure there are comparable tools for SWT that also help.

    That said, I would go with Swing because it runs everywhere. You can't use SWT in an applet, etc. With a good tool there's no reason not to use Swing. SWT used to be faster, but that is no longer the case. Swing is as fast as native desktop apps, and it looks good, too. With Java 6 (ocming soon) it will have even better native look-and-feel because it will use more of the native toolkit.

    Btw, the original poster was on drugs for putting AWT in the same category as Swing and SWT. AWT is at a lower abstraction level. It is not a GUI building kit. It is a kit for putting primitive stuff on the screen. If you want to write a GUI app you would use AWT, but as a layer under Swing.

    ------------
    Upload images and videos - hey, it's based on Swing in fact

  28. Re:Google Cache - why? by Anonymous Coward · · Score: 0

    Why would someone want to do that? In the end, it's /. !

  29. SWT if Sun would adopt it by DrXym · · Score: 1
    JFC is a fine class library but it is horribly, horribly slow, and not even the latest versions pick up the native look & feel properly. Of course JFC is a nice API so that counts for it, as does the fact that installs by default, as do the abundance of tools. But SWT uses native widgets for its rendering so its considerably faster and more integrated with the environment. If both shipped in the same box, I'd pick SWT. As they're not, I'm reluctantly stuck with JFC.

    AWT is a waste of time. It's just too antiquated.

    1. Re:SWT if Sun would adopt it by anomalous+cohort · · Score: 1

      About two years ago, my familly needed a simple budget aware checkbook application. Since it is such a simple application, I chose to make it a learning opportunity and so I wrote it twice; once in Swing and the other in SWT.

      Both looked and acted great in Windows. The same was not true, however, when I tested under Knoppix. The swing app performed the same. The SWT app looked like sh*t and tended to freeze up for no reason that I could account for.

      One of the big advantages of Java is the flexibility of the native platform neutrality. Because the SWT's app's stability and usability varied greatly depending on platform, I have to recommend against it.

  30. SWT vs Swing - no clear winner by AndrewStephens · · Score: 1

    I can't read the article but IMHO there is no clear winner in the SWT vs Swing debate (AWT died years ago).

    Swing is slower and not quite native, but comes with every Java VM (or the important ones anyway) and is very flexible.

    SWT is fast and more native, but requires external machine-specific JARs which can be a pain to deploy, and has a more limited design.

    In Java I tend to use Swing because I am making applets, so the deployment issues are important to me. If I was going to create a large-scale application like Eclipse I would be tempted to use SWT, since the installer could handled the SWT specific issues.

    Java programmers really should not be complaining about having two first-class GUI APIs.

    --
    sheep.horse - does not contain information on sheep or horses.
  31. curses by appleLaserWriter · · Score: 1

    or even ncurses

  32. WinLAF by Trejkaz · · Score: 1

    BTW, there is a third-party project providing a look and feel for Swing which fixes some of the bugs with Sun's implementation which would otherwise take forever to fix.

    It's called WinLAF.

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
    1. Re:WinLAF by Anonymous Coward · · Score: 0
      Hm... last entry is "News (18 Feb 2005)". The Winlaf.org domain is taken over by a squatter. Looks like dev.java.net has the caliber of projects as sourceforge.

      Nothing for you to see here, I'll go back to .NET, where at least my toolkit isn't going to disappear because someone forgot to pay the $10.

    2. Re:WinLAF by Trejkaz · · Score: 1

      Right, the last update of WinLAF was around 18 Feb 2005, but when was the last update of the Windows L&F itself? Some time around 2001? Seriously, this project does make Swing look much more native, and even if it hasn't been officially released in a while, that still means it's being updated twice as fast as Swing itself. ;-)

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
  33. Re:As this is a typical Slashdot wankathon story.. by forgotten_my_nick · · Score: 1

    What a pile of FUD. Like says that a myth that SWT is faster then Swing, but when you read it you find he hasn't proven it at all.

    I use SWT from day to day. Absolutly no problem. The only thing I might agree with the article is that SWT can be hard to learn. However just get swt designer http://www.swt-designer.com/ . Even an idiot could design GUI from that. But hey designing good GUI is hard regardless of the API used.

  34. Question by Orlando · · Score: 4, Interesting

    This may be a dumb question, but why can't Java just provide access to the existing desktop GUI (Windows, OSX, QT, whatever) rather than re-inventing the wheel with it's own set of widgets that inevitably don't look or behave like native apps?

    --
    -= This is a self-referential sig =-
    1. Re:Question by LeninZhiv · · Score: 3, Informative

      You can use Java with GTK, Cocoa, or native Windows toolkits. The question then becomes, why Java programmers are not interested.

      The basic reason for this is, your application's GUI becomes completely unportable, and you suddenly have little reason for having written it in Java in the first place instead of the platform's "standard" language (C, Objective C, or C#).

      A "middle way" is to do what SWT does and wrap the native widgets with a generic API. This creates a "lowest common denominator" problem, however, since you inevitably have to stick to only using those widgets which all your target platforms have...

    2. Re:Question by mstefanus · · Score: 1

      Having its own toolkit assures that you can do write once, run on many (platforms). Simple as that.

    3. Re:Question by Karma+Farmer · · Score: 1

      This may be a dumb question, but why can't Java just provide access to the existing desktop GUI

      Because Java is supposed to work on Unix, and Unix doesn't have an existing desktop GUI. For many years, Motif was the standard, but those days are long gone. Now, Unix (and especially linux) are just a confusing mush of unstandardized toolkits that make no effort to maintain compatibility with anything (even themselves).

      To this day, if you want a standard toolkit on Linux, you may as well just write one yourself. Mozilla, Eclipse, Java, Star Office, GIMP, Gnome, KDE, and a half-dozen other large projects agree! If you want it done half-assed, do it yourself.

    4. Re:Question by jZnat · · Score: 1

      Well, Qt and wxWidgets are as cross-platform as Java (Qt moreso; it has support for embedded devices and very low-end graphics environments like LCD panels), so I don't see the problem.

      --
      'Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
    5. Re:Question by Anonymous Coward · · Score: 0

      Have to agree: virtually ALL the Java GUI stuff I've seen looks awful. Means you have a real training issue too - the gadgets, and often even the underlying workflow don't work like Windows, OS X, etc.

    6. Re:Question by DeadMeat+(TM) · · Score: 1
      This creates a "lowest common denominator" problem, however, since you inevitably have to stick to only using those widgets which all your target platforms have...
      Alternatively, you can emulate widgets that aren't natively supported by your target platform by drawing them yourself. This is the approach that SWT takes: whenever a "core" widget isn't supported by the native toolkit, fake it. AWT unfortunately took the "lowest common denominator" path, which is part of why developers are so loathe to use it.
    7. Re:Question by Orlando · · Score: 1

      Except that in my (and apparently many other people's) experience it doesn't work. Java apps look like Java apps, ie they don't fit in with the look and feel of the underlying GUI, they feel slow and cludgy, simple clipboard commands are not always implemented, etc. I'm sure I'm not the only person who's heart sinks when I fire up a new app only to discover it is Java.

      --
      -= This is a self-referential sig =-
    8. Re:Question by oopsdude · · Score: 2, Informative

      This may be a dumb question, but why can't Java just provide access to the existing desktop GUI (Windows, OSX, QT, whatever) rather than re-inventing the wheel with it's own set of widgets that inevitably don't look or behave like native apps?

      It's not a stupid question.

      Short answer: Because Java is meant to be cross-platform.

      Long answer: I really don't want to re-write the ENTIRE GUI for each platform I port my app to. Would you? You're right, though - Java apps don't look like native apps. But that's a small thing to sacrifice for my app being able to run on almost any platform. However, they don't "behave" like native apps? Menu behavior is standardized. Buttons are standardized. They may not look the same, but they behave the same

      Basically, you're using "re-inventing the wheel" is the wrong sense of the phrase, when it comes to programming. Sun can re-invent the wheel one time for each platform the JVM is ported to, or it can force you to re-invent the wheel for your GUI for *every* platform you want your app to run on. Pick one.

    9. Re:Question by Surt · · Score: 1

      It does. You just use JNI. But no one wants to do that because it means having to write your application 4 times if you want to run all 4 platforms, and not being web runnable. So instead they offer their own desktop GUI (Swing) which maps onto each of the 4 platforms.

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
    10. Re:Question by Tim+C · · Score: 1

      This may be a dumb question, but why can't Java just provide access to the existing desktop GUI (Windows, OSX, QT, whatever)

      That's fine on Windows and OSX, but what of Linux, Solaris, etc? Do Sun support QT or GTK? Or both? What about Motif? What should happen if none of the supported toolkits are available? Fall back on Swing/AWT or just bomb?

      More to the point, though, suppose Sun did code in transparent support for QT, GTK and Motif. If I have all three installed, how does Java know which one to use? Using the GTK one while I'm running KDE (for example) is going to look just as odd as the "native" Java GUI toolkit does now...

    11. Re:Question by Myopic · · Score: 1

      that's AWT

    12. Re:Question by Anonymous Coward · · Score: 0

      That's what SWT does.

    13. Re:Question by Blakey+Rat · · Score: 1

      As a Mac user, I can assure you that Menus are not standardized. (Although I give you buttons.) Every time I use some crappy X11 application or Windows/Linux port on my Mac, and the menu closes the nanosecond my mouse leaves the menu rectangle, I know that whoever wrote it certainly isn't a Mac user or, presumably, even a *mouse* user.

      Look, if I'm in a menu, and there's a submenu, give me a little bit of leeway so I can move the mouse *diagonally* from the menu to the submenu. I'm sick of all these crappy menus that close the nanosecond the curser leaves, so you have to open the menu *again* then move the mouse really slow and carefully to hit the submenu. Grah.

      Also, Mac textfields look/act absolutely nothing like Windows or Linux textfields.

    14. Re:Question by Orlando · · Score: 1

      Do Sun support QT or GTK? Or both?

      Sun build in support the leading toolkits, then let the user decide which one they want.

      how does Java know which one to use?

      Config file? Part of the install/config process for the JVM asks me what toolkit I'm using, or even does a search and gives me a list of available toolkits on the machine to choose from.

      --
      -= This is a self-referential sig =-
    15. Re:Question by Orlando · · Score: 1

      Long answer: I really don't want to re-write the ENTIRE GUI for each platform I port my app to. Would you?

      Certainly not, that's what an abstraction layer is for. As a Java GUI coder I would be presented with a single GUI API, and then it's up to the JVM developers to map that API into the GUI/toolkit of the OS I happen to be running the code on.

      The only argument against this I can think of is that there isn't a good set of lowest common denominator widgets available across the board. But I can't believe that's the case?

      --
      -= This is a self-referential sig =-
    16. Re:Question by angel'o'sphere · · Score: 1


      , but why can't Java just provide access to the existing desktop GUI (Windows, OSX, QT, whatever)


      Simple: if you access a Windows desktop "item" in your java app, it won't be available if the Java app is running on linux or Mac Os X.

      OTOH: if you want to do that you can do it via JNI and ActiveX/COM wrappers (on windows, with the drawbacks mentioned before)

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    17. Re:Question by spectre_240sx · · Score: 1

      Granted I don't do heavy development and I'm still in the learning stages right now, but it seems to me that it might be a good idea for the GUI to be rewritten per OS. Every OS has it's own usability guidelines and one of the problems with Java apps is that they don't adhere to them when they're made for multiple operating systems.

      Then again, I don't entirely know how much work this entails.

    18. Re:Question by spectre_240sx · · Score: 1

      Do you have any links relevant to that subject by chance? I'm quite interested in how that works.

    19. Re:Question by ClosedSource · · Score: 1

      "I really don't want to re-write the ENTIRE GUI for each platform I port my app to. Would you?"

      That's a fine reason for the minority of applications what will be ported to other platforms, but what about the rest?

      Is Java's only value it's (sort of) platform-independence? If not, why not offer the ability to use the native widgets in a straight-forward manner?

    20. Re:Question by Anonymous Coward · · Score: 0

      Yeah, but writing your application four times (Windows, Unix, ?, ?) is probably easier than using JNI.

    21. Re:Question by archeopterix · · Score: 2, Interesting
      A "middle way" is to do what SWT does and wrap the native widgets with a generic API. This creates a "lowest common denominator" problem, however, since you inevitably have to stick to only using those widgets which all your target platforms have...
      This "inevitably" is the consequence of forcing the full cross-platformness down the developer's throat. Yes, if you create One API and force the programmer to use it, the "lowest common denominator" problems are inevitable. But this isn't the only way. I use wxWidgets for my GUI apps. I can stick to the cross-platform API when I want a quick cross-platform GUI, but I can easily take advantage of the platform-specific hacks - they're just one GetHandle() call away. And my app can still be cross-platform, at least as long as I check the current platform before calling win32 or gtk-specific functions.
    22. Re:Question by Glock27 · · Score: 1
      That's a fine reason for the minority of applications what will be ported to other platforms, but what about the rest?

      We're in something of a historical anomaly right now, with a single OS having over 90% marketshare, and a single desktop CPU architecture having over 90% marketshare. All that said, if MacOS gets to 20% marketshare in a few years, wouldn't you like to have an easy port to that platform? What about Linux? Or, heaven forfend, Solaris? AIX?

      "Free" portability is a good thing.

      Is Java's only value it's (sort of) platform-independence?

      No, but that is one if it's larger value propositions. Most don't want to throw it away.

      If not, why not offer the ability to use the native widgets in a straight-forward manner?

      That's more or less what SWT is. It's still portable.

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    23. Re:Question by ClosedSource · · Score: 1

      "We're in something of a historical anomaly right now, with a single OS having over 90% marketshare, and a single desktop CPU architecture having over 90% marketshare"

      You're right about marketshare, but wrong about the implications. Although only a small percentage of applications are ported today, there's more porting today than there has ever been.

      "All that said, if MacOS gets to 20% marketshare in a few years, wouldn't you like to have an easy port to that platform? What about Linux? Or, heaven forfend, Solaris? AIX?"

      Porting is always harder then advertised. In addition, by the time the MacOS gets a 20% marketshare (if ever), today's application will be obsolete. Why make your product less competitive in its original environment in the hope that you'll be able to port it easily later?

      Optimize for your initial market first and you might have the luxury of porting the application later.

    24. Re:Question by petermgreen · · Score: 1

      yep the clipboard issue is a biggie. java seems to lack any native support for copying vector images (for windows that means wmf for other platforms presumablly other formats both would need to be converted to something suited to java) to/from the clipboard so you are stuck with crappy bitmap copy/paste.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  35. AJAX by SoupIsGood+Food · · Score: 2, Insightful

    The correct answer is, "None of the Above."

    Before you invest a lot of time, effort and money crafting a GUI front-end for your application, you should really stop and consider that you may not need one.

    If your app is basically a way of querying a database on a server deep in the bowels of the computer room, you should be coding the interface as a web application. Especially now that AJAX is on the scene... modern AJAX tools and a Java backend can put together some very powerful applications that don't have the same development and deployment costs that an executable on every desktop would.

    AJAX isn't a cure-all, and not likely to help much if you're interacting with local datasets with lots of processing horsepower (as in an imaging program like the Gimp or a sound editing program) or constructing a platform-independant application that's mostly self-contained (like a game or a p2p client.)

    It is great for things like CRM applications, scheduling tools, inventory tools and ticket-monitoring... stuff that need to read and set values in a database somewhere. It's even good for applications that were previously in the domain of the workstation and the PC, like lightweight data visualization tools and PIMs.

    What's more, the development cycle of an application that only needs a copy of IE or Firefox to run will be a lot easier for you, the user/customer and the poor slobs in IT who would need to come up with a deployment plan, and =then= an upgrade plan when rev 1.2 comes out.

    SoupIsGood Food

    1. Re:AJAX by CrazyLegs · · Score: 2, Insightful
      I'll agree with you to a point. What you're talking about is, really, the old fat vs thin client approach. Fat clients (a la Swing, SWT, whatever) makes loads of sense if:
      • you're in control of your clients/endpoints (i.e. sys mgmt not an issue)
      • you have skinny network connectivity
      • you have sophisticated and/or performance-sensitive GUI
      A thin client approach makes sense if:
      • you are NOT in control of your endpoints
      • you have adequate connectivity
      • you have simple GUI and linear dialogue flows
      • sub-second performance is not a primary requirement
      I've worked (too many) years in both environments and seen them done right and done wrong. For what it's worth, the bank at which I work has it's teller-line app (rich GUI, sub-second performance, etc.) developed in Java (ported from C++) and using Swing. It works just great, but required great design.
      --

      CrazyLegs

      "Pork!!" said the Fish, and we all laughed.

    2. Re:AJAX by Tablizer · · Score: 1

      Ajax lacks a decent editable grid control and an outline/tree control. Those are a must in biz apps.

    3. Re:AJAX by finnif · · Score: 1

      The correct answer is, "None of the Above."

      Before you invest a lot of time, effort and money crafting a GUI front-end for your application, you should really stop and consider that you may not need one.... Especially now that AJAX is on the scene... modern AJAX tools and a Java backend can put together some very powerful applications


      First point is that if you can't accomplish what you want to accomplish in HTML with post-backs, you aren't going to do it with AJAX. AJAX does little more than load panes in the background.

      Second point is it's a lot harder to develop good UIs with AJAX. It takes a remarkable amount of work to get simple things to work in Javascript. There are starting points like Prototype, but when you're finished, it still doesn't work as well as an hour with .NET, SWT or QT. And users have no familiarity with how these arcane UIs are supposed to work. There's no standard.

      AJAX, IMO, is mostly good for one type of organization: internet companies who deploy to the public. Deploying AJAX-y intranet applications to the enterprise sounds like that group needs to revisit their requirements. Most organizations won't want to go there when a harsh light is placed on the idea.

  36. Customer choices. by randyjg2 · · Score: 1

    As a rule of thumb, the most important issue is multiple JRE/JVM management. If you have any issues with this, use SWT as it is not JVM/JRE dependent. On the other hand, SWT's got it's own set of problems...

    Here is some of the issues involved.

    Swing versions are JVM/JRE version dependent. You really need to ship a JRE with your app and make sure it is used.

    In the real worlds, thats not always possible. Customer policies may prevent user control of the JVM's available.

    Even when you can specify the JVM's available on client machines, you cannot always guarantee that the particular one that will be used with your application, or worse yet, that someone won't put in an upgrade to the JVM that breaks everything.

    It is not uncommon to patch the JVM for specific fixes like memory leaks. You have no idea whether or not the JVM/JRE you are running on is vanilla or not.

    Of course, there are lots of other issues involved with using SWT, mostly due to it's immaturity. Don't try real serious OPENGL stuff unless you wanna do a lot of debugging.

    And don't even get me started on embedding Windows apps in SWT programs. It can be done, but, in my experience at least, bug detection requires a Russian Roulette approach unless you write your own code. Some things work, work partially or work for a while and then trash some OTHER program.

    One interesting suggestion:
    If you can pull it off, write your GUI code is some stable environment like VS.NET and call functionality in Java via web services or other remoting technologies.

    The talent pool for skilled GUI developers is a lot larger.

  37. Check out Netbeans 5.0 by Anonymous Coward · · Score: 0
    And the GUI Builder component called "Matisse".


    They basically created a layout manager that would play well with the IDE, as well as be a good layout manager on its own.


    -- ac at home

  38. Versus System.Windows.Forms? by Anonymous Coward · · Score: 0

    Okay, ominous patent-protection aside, how does any of these Java GUI packages stack up against System.Windows.Forms? Or even Gtk# for that matter? The posts in this thread talk about how one is difficult to learn, one is deprecated, the other is hard to learn, none of them correctly GC and tend to leak, etc, etc.

    I'm a .Net developer, so I have a certain liking for objects that just "go away" when you don't want them anymore. A lot of the issues raised here are ones that I don't worry about.

    So, if I wanted to go Java (which is a real possibility) what kind of battle am I facing to switch over? No one here is making it sound like a bed of roses! Feel free to flame me for my choice of technology, but can you at least throw in some useful information in your roast?

  39. wxPython by Anonymous Coward · · Score: 0

    It rocketh. Check out Activegrids IDE for the feeling: http://sourceforge.net/projects/activegrid

  40. Swing is never finished. by adolfojp · · Score: 1

    Swing has improved over the years, but it has improved at an unacceptable pace.

    Call me back when it finally supports Clear Type.

    Cheers,
    Adolfo

    1. Re:Swing is never finished. by Mr.+Competence · · Score: 1
      --
      Those who open their minds too far often let their brains fall out.
    2. Re:Swing is never finished. by adolfojp · · Score: 1

      Thanks for the links :-)
      A couple of years too late but at least they will fix it in a couple of years :-P

    3. Re:Swing is never finished. by aCapitalist · · Score: 1

      And the Mustang betas still have font rasterization issues that will unlikely be cleaned up by the time it ships. You're right. It's just too late in the ballgame for Swing to ever be anything except something server side guys use to leverage their Java skills and produce something that will never see the light of day outside of a corporate office.

    4. Re:Swing is never finished. by adolfojp · · Score: 1
      It's just too late in the ballgame for Swing to ever be anything except something server side guys use to leverage their Java skills and produce something that will never see the light of day outside of a corporate office.
      That was beautifull. Can I quote you?

      Cheers,
      Adolfo
    5. Re:Swing is never finished. by aCapitalist · · Score: 1

      That was beautifull. Can I quote you?

      Hehe, of course.

      Swing really has been a disaster and it didn't have to be that way. Sun screwed up with AWT, blundered again with Swing, decided in the 2001-2003 timeframe that they weren't going to put many resources into Swing because they did recognize java's strength on the server, and then to top it off, didn't even get subpixel rendering in Java 5. Java 5 rollouts are just starting to become mainstream and since Mustang doesn't bring much to the table in the way of language features we can expect it's acceptance to taken even longer.

  41. Re:As this is a typical Slashdot wankathon story.. by TheRaven64 · · Score: 1
    I don't have much experience with SWT, but I do occasionally use one app that uses it; Azureus. I don't know what this looks like on other platforms, but on the Mac it's hideous. No live resizing (outline only), controls not automatically fitting the size of the window (when it starts, you often have to resize it a little bit to force a redraw, and then things line up). Oh, and it manages to leak both memory and CPU[1].

    I don't know how many of these are SWT problems, and how many are just incompetence on the part of the Azureus developers, but since sourceforge lists it as the most active project I am inclined to believe the former. I have used Swing apps on OS X, and Java/Cocoa apps. The former look slightly non-native, and don't feel native, while the latter look and feel native. Neither are anything like as bad as Azureus.

    [1] How do you leak CPU? I find it hard to even picture the kind of design that would do this - perhaps adding things to the run loop and not removing them? Anyway Azureus (Java/SWT) and Psi (C++/Qt) both manage this on OS X.

    --
    I am TheRaven on Soylent News
  42. Book by Beliskner · · Score: 0

    There's quite a few books on choosing frameworks, here's one.

    --
    A caveman dreams of being us, the incalculable power and riches. We dream of being Q, then what?
  43. Bittorrent is not an SWT program by Retype · · Score: 1

    in the middle of the swt is crap they say the official bittorrent is a major user of SWT... Bittorent is made in python, no swt here. Maybe they should put Eclipse as a major user of swt, after all IBM made the toolkit for it.

    --

    I have no sig and I want to scream
    1. Re:Bittorrent is not an SWT program by spinfire · · Score: 1

      Azureus, one of the most popular bittorrent clients, uses SWT.

  44. Windows Forms! by BitwizeGHC · · Score: 0, Troll

    A big developer complaint with Linux is that there are so many GUI toolkits to choose from, they all look different, and have different APIs. With Windows it's different: one standard API, one look and feel. Business developers like that. Java, with its proliferation of different, different-looking GUI toolkits, is suffering from the Linux problem. That makes it less attractive as a deployment platform for real-world applications. For most applications which will be delivered to Windows desktops, the best choice is to use Windows Forms on .NET.

    And don't say web apps. Web apps suck. Their UIs do not scale up to the heavy-duty data entry people do in a corporate environment; they tend to require too much mousing around. Browser Web form usability just isn't up to the standard established by GUI apps, particularly when it comes to keyboard navigation.

    --
    N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
  45. Re:As this is a typical Slashdot wankathon story.. by Anonymous Coward · · Score: 0

    Did you even read the linked article from the story? No, the SWT Sucks article is not FUD, it's 100% true in basically everything it covers. I use both Eclipse and a Swing-based text editor, Eclipse is far slower than the Swing application. There, proof that SWT is slow.

    But if you read the article, you'll discover that Swing is far superior to SWT. They offer a feature comparison, which is basically a giant list of things that you can do in Swing that you can't do in SWT. Swing is more robust is absolutely everything compared with SWT.

    After reading that article, I have no idea why anyone would ever use the SWT. It's slower than Swing, it's less feature-rich than Swing, and it's more complicated than Swing. Why would you ever want to use that?!

  46. Re:As this is a typical Slashdot wankathon story.. by phasm42 · · Score: 1

    I use Azureus under Windows, and this application actually got me interested in SWT because it's the best looking Java app I've seen. I'd have to agree that this points to a SWT problem. Azureus 2.4.0.0 is out -- you could hope they've made some progress :-]

    --
    "No one likes working in a hamster wheel, and your shop smells of cedar shavings from here." - TaleSpinner
  47. Re:As this is a typical Slashdot wankathon story.. by Paradise+Pete · · Score: 1

    I didn't realize Azureus was an SWT app. I did, though, realize it was unusable, at least on OS X. It eventually (and seemingly inevitably) manages to completely monopolize the computer. Every once in a while I try a new version, but it's been a while since the last time, so maybe things have improved.

  48. Most typical client apps by codepunk · · Score: 1

    Today if you are not building it for the web you are just plain wrong. Now granted there are a few apps that will not fit the web model but no many.

    --


    Got Code?
  49. Swing is hard but effective by kherr · · Score: 1

    Swing is a bloated nightmare of an API, way overly complex for what it tries to do. It gives you great flexibility, but things that should be simple—like setting a fixed width (of the right width) for a JTree—are actually difficult programming tasks. Heck, everything is time-consuming. If you work long enough on your GUI, Swing does give you the power to do a lot. But it isn't trivial to use, unlike AWT.

    When Swing was introduced as an add-on package (for Java 1.1) the size/memory was a big deal, but Swing solved a lot of GuI performance problems that plagued AWT. Nowadays Swing is an integral part of Java and comes "for free", and the memory issues don't mean as much when you're using computers with gigabytes of RAM. Meanwhile the performance issues of AWT have been largely solved by improvements to the JVM. As for SWT, it seems to me like an extra class library to have to load and run, with native bindings. Kind of the worst of Swing and AWT combined, although many people like using it.

    I am a bit biased towards Swing, doing everything on Mac OS X. Apple has implemented class library caching and sharing, and they've hardware-accelerated a bunch of the Swing drawing. I recently ran some of my Java stuff on an Intel-based iMac Duo and things ran lightning fast; seemed almost faster than Carbon stuff. Almost.

  50. Bongo. by phooky · · Score: 1

    The best Java widget set I ever used was Marimba's Bongo, back in '97 or so. It was fast, lightweight, extensible, and even included its own sweet VB-like interface editor. Like so many other great early Java libraries (remember JGL, anyone?) it was killed by Sun's insistence that they were about to ship their own widget set with java, which pretty much put the kibosh on third-party widget set development. Two years later, we finally got... swing. Which is just one of the reasons I haven't written a line of Java code in over four years. -p

  51. A fourth option: SwingWT by caseih · · Score: 2, Informative

    As the article mentioned, Swing is a very good, advanced toolkit with some advantages over SWT. A project called SwingWT is an implementation of Swing using SWT, giving you a much faster GUI that looks and feels more native. So you can do all your development and initial testing with pure Swing, then swich the UI classes to SwingWT for a native look and feel on the hosts that support SWT. Seems like an interesting idea to me.

    1. Re:A fourth option: SwingWT by Anonymous Coward · · Score: 0

      So you can do all your development and initial testing with pure Swing, then swich the UI classes to SwingWT for a native look and feel on the hosts that support SWT.

      Test under one configuration and deploy under another! Brilliant! What could possibly go wrong?

  52. The end-user doesn't care about the API by Plouf · · Score: 1

    Swing is ugly, period. Why? Because it does not follow user's preferences and standard look&feel. Most of the previous posts seem to assume that the API is important. It is not. What is important is whether the user will like using your application or not. And, sorry, but most of the users are on Windows, and there is a standard look&feel Swing does not follow. Therefore, the users won't use your Swing application. Ever wondered why Java had so much trouble breaking through on the client side?

    If you remember that most of the applications don't have to be run on all platforms, but only on some specific ones (Windows, MacOS), and that most of these applications won't need to be run from a webserver (common! my mother won't install a webserver just to use Excell nor to start her tax computing tool!), you only have the choice between .Net and SWT. Why? Because both are able to display a transparent red scrollbar if the user decided that all scrollbars should display that way. I want my Windows users to start a Windows application, not a Java application. I want my MacOS users to start a Mac application, not a Java application. They don't care about Swing or SWT, they really don't! But they want their nice-looking transparent red scroolbars!

    Swing is a nice toolkit when you code software for other coders, or when your target audience is running Linux. For the remaining...

    1. Re:The end-user doesn't care about the API by anomalous+cohort · · Score: 1
      Swing is ugly, period. Why? Because it does not follow user's preferences and standard look&feel.

      The biggest preference that all users have is price. They want the software to be as affordable as possible. If it costs me $500K to develop a Windows application where I expect there to be 5K users and $100K profit, then I have to charge $120 per license. If I have to spend the same amount to develop the same app on Mac OS X and I expect there to be about 500 users, then I have to charge $1,200 per license. That's a lot of money and most users won't pay that much so guess what? I end up not developing the Mac OS X version.

      With Swing, I have the same development costs but the potential to sell to a larger market. I still pay $500K and expect $100K profit. I now have a target that is 5.5K in size. Per license cost is now $109. That's a 13% savings for the Windows user and a 91% savings for the Mac user. As a user, I would gladly give up the ability to make my scrollbar red if I could save that much money.

    2. Re:The end-user doesn't care about the API by Plouf · · Score: 1

      I don't get the point here: SWT is platform-independent and it is therefore easy to port from one platform to another. I'm not talking about developing the application in VC++!

    3. Re:The end-user doesn't care about the API by anomalous+cohort · · Score: 1
      I don't get the point here: SWT is platform-independent and it is therefore easy to port from one platform to another.

      It has been my own experience that SWT doesn't play so well on non-windows platforms. Even the original article implies this...

      If you are developing only for one platform, SWT has an advantage in host compatibility, including integration with host features, such as use of ActiveX controls under Windows.

      I guess that I assumed you already recognized this. After all, why would you (from your original post) say...

      If you remember that most of the applications don't have to be run on all platforms, but only on some specific ones.

      ...if true platform neutrality was a reality in your recommendation of SWT? If the issue truly is only one of...

      most of the users are on Windows, and there is a standard look&feel Swing does not follow

      ...then all you have to do make your swing app have the windows look and feel is to use the com.sun.java.swing.plaf.windows.WindowsLookAndFeel pluggable LookAndFeel class.

    4. Re:The end-user doesn't care about the API by Plouf · · Score: 1

      There is a world between true platform neutrality and easy platform port. I don't beleive into the first one (my own experience of non-trivial *client* applications, even written in Java), but I seek the second one.

      About the Swing WindowsLookAndFeel, it is only an emulation and any experienced Windows user will dismiss it quite quickly. Especially if this user selects a custom desktop theme. If this theme decides that all buttons should be round, the Swing PLAF will still display square ones... There are zillions of details a Windows user would expect (such as double-clicking a column title separator to get it autosized for instance) that Swing "forgot" to implement. The same for any other platform.

      Today my application is written for Windows users. The day I have to port it on Mac, I will need to change some parts of the GUI. Just because the way a Mac application behaves is not the same as a Windows application should behave. Windows uses a "control panel" paradigm while Mac uses a more "drag&drop" approach. Even if I had a perfect transparent portable GUI library, I would have to update the application according to the user expectations. SWT allows me to customize my application according to these expectations for some platforms and at a reduced cost. Swing prevents me from doing so on ALL platforms.

      Swing is not an option when you need to create an application my mother should use. It is, however, a perfect choice when you need a cross-platform corporate application "à la" SAP.

    5. Re:The end-user doesn't care about the API by petermgreen · · Score: 1

      It is, however, a perfect choice when you need a cross-platform corporate application

      translation: its a perfect choice where the users will have no choice but to put up with the differences between swing and thier native apps.

      btw i think the windows pluggable look and feel is a stupid idea. it might fool some newbies to start with but ultimately having something that looks the same but isn't is just going to confuse more than help.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    6. Re:The end-user doesn't care about the API by anomalous+cohort · · Score: 1

      Okay, I think that I get where you are coming from. In the world of visual interface design, this is called external consistency. Sun makes the claim that the Swing look and feel is externally consistent with the Java platform which makes sense to multi-OS users because they want the application to look the same no matter what OS they are running it on. That claim makes no sense to single-OS users (e.g. your mother) because it means for them that they have to learn a new look and feel without a good reason.

      Just out of curiosity, I would be interested to know if your mother had a computer running Windows 95/98/ME and had to upgrade to XP. If so, then what was her feelings regarding that change in look and feel?

    7. Re:The end-user doesn't care about the API by Plouf · · Score: 1

      I don't know: when I installed XP from w2k, I also switched back from the "lego" interface to the old 2k theme.

    8. Re:The end-user doesn't care about the API by anomalous+cohort · · Score: 1
      switched back from the "lego" interface to the old 2k theme

      Yea. Me too.

  53. Re:As this is a typical Slashdot wankathon story.. by forgotten_my_nick · · Score: 1

    Yes I read the article. Its a pile of crap as articles go. First up it claims that issues with the UI based on only two applications. It doesn't go into details what those UI related issues are, but as someone has pointed out one of the apps isn't that great to begin with on a mac. Eclipse is probably one of the best examples of how SWT works. I am also using Workplace 2.6 Beta (which can render SWT via HTTP I might add) and it is on par with most windows apps.

    Limited Functionality? He doesn't detail in anyway how it is limited in relation to Swing. All he details is coding differences. Likewise the only thing he can come up with is that you can't put an image + text on a button at the same time.

    sorry but the article is airless bamf. Something a bit better then "I use both Eclipse and a Swing-based text editor, Eclipse is far slower than the Swing application. There, proof that SWT is slow." please.

  54. Too many freakin' guis by borgheron · · Score: 2, Interesting

    This is the trouble with Java.. there are too many GUI libraries. Standardize on one and forget the rest. It seems that when an environment is born without one, it's destined to search for the perfect gui framework forever.

    As an example of an evironment which has never had this problem, take Mac OS X, it has had AppKit since the day it was created... and it will never see another major gui framework. Ah, yes... you can say but there's GTK and others available on the Mac, but they are not a threat to the *MAIN* AppKit framework... (they do, in fact use AppKit, so they aren't an outright replacement).

    Intersting dilemma...

    But... to get back on topic, I prefer SWT, it's faster, and it blends more readily with the native environment than the others.

    GJC

    --
    Gregory Casamento
    ## Chief Maintainer for GNUstep
    1. Re:Too many freakin' guis by Animats · · Score: 1
      Mac OS X, it has had AppKit since the day it was created... and it will never see another major gui framework.

      Application developers who used Metrowerks would disagree. They're faced with a rewrite (or dropping Mac support) because of the transition to IA-32.

    2. Re:Too many freakin' guis by borgheron · · Score: 1

      Application developers who used Metrowerks would disagree. They're faced with a rewrite (or dropping Mac support) because of the transition to IA-32.

      Perhaps I should clarify: Cocoa (which used to be OPENSTEP) has never had this issue. Metrowerks, I believe was mainly for developers who were developing Carbon apps for the Mac, Carbon is different from Cocoa.

      Also, I'm referring to the set of libraries/frameworks as a "development environment", regardless of the IDE used to build the applications.

      GJC

      --
      Gregory Casamento
      ## Chief Maintainer for GNUstep
    3. Re:Too many freakin' guis by bokmann · · Score: 1

      Dude,

          if you don't like to have a choice, then drink the kool aid and use Swing. Swing is the ONLY rich gui that is baked in to Java and has Sun's blessing. AWT is mostly deprecated (Swing is built on top of AWT, so some things are still used), and SWT, while sexy, brings deployment complexity and platform specific libraries.

    4. Re:Too many freakin' guis by spitzak · · Score: 1

      GTK and other toolkits (except perhaps WxWindows) that are ported to OS/X do NOT use the "AppKit" by any normal definition of "use". At least GTK (and FLTK which I am writing) use Quartz and thus are implemented just like AppKit. Perhaps others use AppKit to create windows but they certainly draw their own graphics inside them, claiming that such a program "uses" AppKit would be like claiming all web pages use AppKit because when Safari displays them they are inside an AppKit window.

  55. Re:As this is a typical Slashdot wankathon story.. by Surt · · Score: 1

    Unfortunately, they're both right.

    --
    "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  56. behind the times by Dan9999 · · Score: 1
    "Each tool kit offers advantages and disadvantages that make selecting one more appropriate, given your needs and intended audience."

    That should say some are missing features and some have bugs.

    I mean give me a break, haven't all the other companies moved on? Sun can't even get a 2D gui control toolkit together and it's 2006. This should have been one of the first things they did.

    Did they really want to keep having ugly, weird working scrollbars, no-colour, no style interfaces unless the programmer spends as much time on the gui as the rest of the program? If yes then success is at hand.

    Personally I would just raise the bar and consolidate.

    Sun, question to you: how long did it take to figure out that you restrict programmers on the use of the if statement? I'm sure you and several 3rd parties could have had a thousand if packages, IMAGINE THE CHOICE!!! You would have ruled my friend!

    Stuck in the past, stuck in the past. I don't see other mature companies still wrestling with evolution on 2D gui toolkits. You're still in the playground on that.

    "The nice thing about standards is that you get to choose from so many." Should be your motto.

    whatever

  57. Fully portable applications don't exist by aclidiere · · Score: 1
    Since you mentioned "bundling the necessary libraries with your app", I'm assuming that we're talking about a desktop application, as opposed to a Java client applet.

    I think that in the desktop world, there isn't such a thing as a portable application. Programming in Java helps writing for multiple platforms, but there is a huge amount of work that will have to be platform-specific.

    Even if you are programming in Swing or even in SWT, you will to write native code or handle native code. Here are some examples:
    • You will need an installer.
    • Your application may need to inspect the system or read system settings. You will use different native APIs for each platform your application runs on.
    • You may need to verify that a font is installed. (The AWT API is wrong about Font names -- it doesn't know how to read them properly.)
    • The Swing API doesn't allow setting an application icon in several different sizes -- you may want to do that yourself. There are native APIs for that.

    If you do mean to build an app that runs on a Mac, you will need a Mac.
  58. Why are java applications so ugly? by JoshRoss · · Score: 1

    I cannot think of a java application that I have used that has not been ugly. The UI people often do not make the best programmers and the programmers often suck at designing good UI. And, WHY THE FUCK CANT YOU COMPILE JAVA INTO AN EXE?

    1. Re:Why are java applications so ugly? by JoshRoss · · Score: 1

      Sorry about the caps, its just the tourette syndrome.

    2. Re:Why are java applications so ugly? by Anonymous Coward · · Score: 0

      Does that cause the cluelessness as well, or is it just an unfortunate coincidence?

    3. Re:Why are java applications so ugly? by Glock27 · · Score: 1
      WHY THE FUCK CANT YOU COMPILE JAVA INTO AN EXE?

      I run most of my stuff under Linux, so no .exe required...

      On the other hand, gcj produces nice native executables. ;-) It doesn't support Swing (yet) but does support SWT.

      I haven't looked at it in detail yet, but the JCVM project that was donated to Apache Harmony seems interesting as well.

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
  59. MOD PARENT UP- No fully-portable app exists by aclidiere · · Score: 1

    You are right in saying that "You really need to ship a JRE with your app and make sure it is used"

    Actually, I have seen very few programmers recognize that. That supports my point that there isn't such a thing as a fully portable desktop application.

    In addition to the problem of JRE that you mentioned:
    • Every application needs an installer.
    • Many applications need to access system settings that are not accessible from a Java API (may it be Swing, SWT, or Foundation Classes).
    • There are things that no Java UI toolkit handles properly, and you will have to write native code to do it yourself. (For example, Swing is bad at application icons, Fonts, Open/Save dialogs, and some of the handling of Unicode.)
    1. Re:MOD PARENT UP- No fully-portable app exists by randyjg2 · · Score: 1

      If we are on general advice, add that the cardinal rule of development is never install anything newer than a maintenance release of any software package unless you love debugging or your psychotherapy for masochism is not working.

      On the subject of shipping an installer: You need to qualify what is an installer. What is needed is not a conventional installer, or even a package manager, but an autonomic manager like IBM is working on.

      Lets look at the options you have

      Packages (like rpm's) can install but all they really are is styized scripts. If the script writer forgot something (and they invariably do) or got something wrong, they are useless. For example, one custom Ant rpm I ran across put a configuration file in /etc ... took me five hours one night to find out why my brand new personal install of Ant was being ignored.

      By extension, package managers like Apt, yumex, smart or even YAST can be screwed up by just one badly packaged piece of code.

      Installers (by which I define as non packaged based mechanisms) also have lots of problems in practice for the same reason. Anyone who has ever used Oracle Universal Installer (in which Oracle has put in a LOT of skull sweat and hard work) can testify to that.

      The commercial and OSS "wizard" installers aren't too bad, provided you don't push their capabilities.

      Personally, as far as semi manual installers go, I have found auto*/.configure/make/make install to be the most reliable of this bunch, albeit not to most skill sets or taste. In the Java space maven seems to be a tolerable solution.

      IBM style autonomic computing installers would be ideal, but they are far from reality.

      What really works nicely is the "plugin" based installation frameworks, like OSGi/Eclipse. Installing a new Eclipse plugin is a snap. If the major distro's adopted an mixed service/dependency injection plugin solution such as an ESB like, say ServiceMix (JBI/JSR208), installers could finally become a real solution, instead of a kludge.

      I dunno if I agree about the OS access. Java has a lot of built in OS support (I espcially like the concurrent packages) and covers 95% of everything you want to do with built in API's. For everthing else, there is ProcessBuilder.start() or Runtime.exec(). Granted, you have to be pretty detail oriented to use them properly but I haven't hit anything I could not get working.

      Swings PLAF's aren'tthat bad,especially in the latest versions. Its the defaults that are to blame.

      Unicode is another matter. Java has GREAT Unicode support. what is doesn't have is many programmemrs that know how to use it properly.

  60. Swing! by Mutatis+Mutandis · · Score: 1

    I like Swing, mainly because it can be easily extended to do things with components they were not originally designed for. You can fairly rapidly build a relatively complicated user interface, with custom components, custom events, and multiple interacting display windows, and still have perfectly manageable, re-usable code. (Well, if you work outside graphical designers, which in my humble opinion should only be used for developing write-only code.)

    I agree that it can take an effort to master it, and that developing simple interfaces can take extra time because of the overhead. But Swing's structure is quite ordered and I have found that Swing suits "my" logic; it comes fairly natural to me as a programmer.

    I like Swing much more than AWT, which IMHO was not very good at all, mainly because the event handling model was awful. For me the biggest problems with early versions of Swing were in the use of images, and while the image handling libraries are much more powerful and rationally organized now, they are also unpleasantly complex. But it is good enough. I have never tried SWT.

    Web interfaces are nice for many applications, but for most of the things I do not really an option. For database applications a pretty good middle way seems to be Java Web Start, which allows you to use a web server to distribute your code, but still to run it as a very flexible application on your desktop.

  61. Re:As this is a typical Slashdot wankathon story.. by Anonymous Coward · · Score: 0

    I use both Eclipse and a Swing-based text editor, Eclipse is far slower than the Swing application.

    Yeah, sure. Eclipse vs a text editor... And my C-64 boots faster than a Linux box with dual Xeons.

  62. Re:As this is a typical Slashdot wankathon story.. by Anonymous Coward · · Score: 0

    Not the one the poster linked to, the one that IBM wrote and is linked in the Slashdot article. When IBM says SWT sucks, and they wrote it, perhaps you should listen to them. It's IBM DeveloperWorks explaining that you should use Swing and not SWT. The IBM article contains a LONG list of features that SWT is simply missing.

  63. A Rule of Thumb by jkauzlar · · Score: 1

    Unless you have to, stay away from Microsoft products. It sounds awefully narrow-minded, but why deal with a mega-corporation that doesn't give a &#$ about their 3rd-party developers when you have a world of less legally-entangled tools to work with? Patents or none, microsoft, unlike Sun, looks at 3rd-party developers like customers, not 'co-workers.' Having the apache project and IBM's support behind Java make it all the more attractive, even if its not the best language for many things (client-side apps especially). Microsoft is so haphazard about backwards-compatibility I always have to wonder if anything I wrote a year ago is still going to work under the latest upgrades and patches. It's the monopoly-tax. Don't pay it unless you're getting paid well to do so!!

    1. Re:A Rule of Thumb by fejta · · Score: 1

      Good idea, why deal with a mega-corporation that doesn't give a rat's ass about their 3rd-party developers (MS) when you can deal with a small corporation that doesn't give a rat's ass about their 3rd-party developers (Apple). Bravo!

  64. Java native code compilers by tadmas · · Score: 1
    WHY THE FUCK CANT YOU COMPILE JAVA INTO AN EXE?

    Probably because you haven't installed the compiler. Google for "Java native code compiler" or try Excelsior JET.

  65. SWT disappointed me big time by Anonymous Coward · · Score: 0

    Ever tried to open a print dialog on linux with SWT? After spending a few days learning SWT I stumbled upon this bug which has been known for over three years. https://bugs.eclipse.org/bugs/show_bug.cgi?id=2479 6/
    So much for SWT apps being portable even between the platforms that they support!

  66. Re:As this is a typical Slashdot wankathon story.. by Tim+Browse · · Score: 1
    I don't know what this looks like on other platforms, but on the Mac it's hideous.

    It's not so bad on Windows - at least in terms of look and feel. It's definitely the least hideous Java app I've seen - in fact the only one I've ever carried on using after trying it. It has some non-standard appearance here and there (e.g. tabs).

    But it still manages to, e.g. fail to redraw the main list view controls properly when you drag other windows over it. Like, really badly. Like great swathes of window area being left empty and unrendered. I'm not sure how you manage to screw up something as basic as that so badly.

    Which doesn't fill me with confidence about SWT, tbh.

  67. In summary by petermgreen · · Score: 1

    AWT: old, based on OS controls but didn't do a brilliant job of doing it cross platform. Age means its the best choice for portability (e.g. it will run on both the MSJVM shipped with many versions of windows and virtually every sun jvm)

    SWING: built on some of the very basic awt classes (container window frame and applet) with a widget set written in 100% pure java, consistant behaviour accross operating systems but even if you choose the platform look and feel its still a clone and there are liable to be subtule differences between your app and native apps. Also has a reputation for being slow (which was undoubtablly true with some versions though i belive this has improved) can run with things like the msjvm provided you are prepared to put up with downloading the swing classes.

    SWT: also based on the native gui components but didn't try to be quite as deep an abstraction so will generally run faster and be more familiar to those used to writing native code. However as a third party library using its own native code it cannot be used for stuff like browser applets or java web start.

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  68. Or OpenLaszlo ? by jon1012 · · Score: 1

    Even OpenLaszlo (widget system using flash, and being open-source) can be good for this, enabling a good user interaction (just like a real desktop app), and permitting to use any server-side language to do the right job...

    I mean, isn't that a good solution ? :) (as well as AJAX, but with less work, since you use real widgets)

  69. Re: why there are three toolkits is simply.... by obiwan2u · · Score: 1
    [begin rant] Does anybody think it would be better to have standard's making institutions actually create and implement standards like these? (with enough funding to do it properly).

    Just getting a little political here, the "no big government interference/industry knows best" conservative political point of view hasn't worked here. And it's not just an academic question, this sort of thing degrades productivity, which means everybody is less efficient.

    Oh sorry, I forgot, there already is a standard GUI interface, from Microsoft. Never mind.

    --
    Ben in DC
    "It's the mark of an educated mind to be moved by statistics" Oscar Wilde
  70. Why we had to dump Windows.Forms and use GTK# by Jamie+Lokier · · Score: 1

    Two simple reasons:

    1. Get to 10000 widgets (easy: a list of 400 little control panels did it), and then watch as .NET falls over on Windows 2000 due to the system handle limit. It gets slow quite a bit before that. It's possible to workaround, but takes quite a lot of code.

    2. Extremely crap layout. .NET 2.0 improves on this; we were using .NET 1 though.

    Gtk# does not have the handle limit, and has much better layout than .NET 1's Windows.Forms.

    Unfortunately, it's still slow at things like updating a hundred table cells, and its table/tree widgets are very limited in what can go in the cells.

    The ideal widget set in my experience would have a lot in common with the rendering, styling and layout done by a web browser. Which is, in my opinion, another reason why AJAX is popular. (The underlying logic is obviously far from ideal, though).

    -- Jamie

    1. Re:Why we had to dump Windows.Forms and use GTK# by rainman_bc · · Score: 1

      If you think AJAX, rendering 10,000 widgets will be any more efficient...

      Seriously, you'll watch your memory consumption skyrocket while it attempts to lay out your pages... AJAX or not... 10,000 widgets is still 10,000 widgets. No platform should be stretched to that.

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    2. Re:Why we had to dump Windows.Forms and use GTK# by Jamie+Lokier · · Score: 1
      Firstly,

      If you think AJAX, rendering 10,000 widgets will be any more efficient...

      I don't.

      In replying to my post, you've mixed up two unrelated points: limitations/speed, and attractive, natural rendering.

      I think AJAX is popular now in part because it has a nice, boxes within boxes, typographical model with great style. It's easy to create good looking interfaces that flow with their content, whatever the content.

      I'm not saying that AJAX is fast for 10,000 widgets.

      Although, for some simple things like presenting large amounts of data in a document-like format, AJAX is ok for small incremental changes even to large documents.

      Prettiness, and presenting large quantities of data in a document-like format, are what it's good at.

      That's why I say my vision of a great widget set would be a bit like HTML in terms of it's layout, style and rendering, and use a similar block/inline tree model for structuring the widgets.

      I guess Mozilla's XUL is that. (But too slow for my taste).

      That's something Windows.Forms could have done, but Microsoft didn't want to rock the boat too much with it, so it's like a cut-down Win32 with much of the historical baggage, early 90s layout, and minimal styling.

      Gtk#'s model is closer to that, but still lacking: for example, in Gtk#'s tree/list widget, you can't put arbitrary things into the list cells. That sucks when you want something natural like a column of buttons in a table.

      Secondly,

      10,000 widgets is easy to reach. For example, take a popular Slashdot article which receives a lot of comments - 500 comments, say. Now count the number of widgety things on the comments page. Remember to include every nested box and control and style of text. It will greatly exceed 10,000.

      It's a bit slow to draw the first time, but it works. Web browsers handle that size of problem daily. Users are used to it. It's quite comfortable to interact with. As a user interface, it works. There is nothing wrong with similar interfaces to applications that present a lot of data.

      Using Windows.Forms, on Windows 2000 or earlier, you can't layout at that scale at all. (On XP the limit is different, and much larger. Someone must have decided it was an annoying limit).

      We had an application that was quite similar to that. A long list/tree of things, each of which needed a bunch of detail, and easy scrolling over them.

      There are a bunch of ways to make it work: creating and destroying visible widgets on demand; or changing the user interface so that long lists of complex items can't ever exist regardless of the data set. But all of those were significant work or changed the user interface in some unsatisfactory way. Especially the layout code was a lot of work.

      We could have lived with all that, but switching to Gtk# was just easier. Gtk# has better layout algorithms, a little bit like the HTML boxes model, which is a compelling bonus.

      Programming with Windows.Forms feels like going back into the 90s. Having to code your own layout for everything, and having to modify bits of code all over the place to tune the style when the default doesn't work well, is tedious. And it still looks ugly.

      Gtk# is a bit better. Not a lot better, but enough to consider using it. And it's cross-platform, which is a nice bonus.

      -- Jamie
  71. A question about applets by Jamie+Lokier · · Score: 1

    You say you using Swing because you're writing applets.

    I've used AWT, because some of the web browsers I was deploying to didn't have Swing. That was a couple of years ago.

    Is Swing ubiquitous with all browsers these days? What versions? (Or a link to a site would be handy).

    Cheers,
    -- Jamie

    1. Re:A question about applets by AndrewStephens · · Score: 1

      The Microsoft JVM does not (and never will) support Swing, or any of the more advanced Java features. Since Microsoft has dropped all support and has removed their JVM from Windows, I decided that it wasn't worth trying to cater to the minority of users that still have it, I just tell people to go to www.java.com and download the Sun JVM if it doesn't work.

      Then again, I am not trying to make money off my applets, so I don't care if some people can't use them.

      I don't have the page handy, but Sun has claimed that 50% of browsers have the Sun JVM installed. I don't know whether to believe that or not.

      --
      sheep.horse - does not contain information on sheep or horses.
    2. Re:A question about applets by Jamie+Lokier · · Score: 1

      That's a shame, about the JVM being dropped, because as I understand it support for .NET applets in a Windows browser is still very hit and miss, so that leaves a bunch of people who don't have any kind of applet support out of the box.

      I guess that's why we're seeing more and more use of Flash for mini-applications in a browser (when AJAX etc. aren't suitable or would be too slow). Nearly everyone seems to have Flash.

      My question about Swing support was actually directed to Linux browsers: Last time I checked, Netscape 4 didn't have it and that was still in use, but of course there aren't many people left using Netscape 4 now.

      Then again, I've bumped into a fair number of people using Mozilla / Firefox on Linux who don't have a JVM, either because they don't want it, or because the installation package didn't work.

      And then there's those Macs that lack a JVM too.

      I guess Flash really is the only fairly ubiquitous applet platform left. And Javascript/AJAX the only ubiquitous way to make a dynamic page now (assuming graphical browser); shame that's so limited and slow.

      Sun's point about 50% of browsers having the Sun JVM could be true, because Firefox on Windows comes with the Sun JVM doesn't it?

      With my applet (which is not for making money either) I'm targeting people who travel and use Internet cafes, so installing a package is usually not an option. I did manage to install Sun JVM on a Windows box in an Internet cafe not so long ago, and it took about 30 minutes, rather defeating the point.

      -- Jamie

    3. Re:A question about applets by AndrewStephens · · Score: 1

      The Microsoft JVM was amazing for its time, but that time was seven years ago. It has many problems and limitations (no Swing being only one of them) and I am not sorry to see it go. The .NET framework is even more annoying to install than the JVM, many people don't have it, it will only even work under Windows, and even there only under Internet Explorer. I see no advantage in .NET over Java for general internet distribution of applets.

      Installing the JVM on Linux is a pain - it works but you have to jump through hoops that many people can't be bothered with.

      MacOSX has excellent support for Java built in, although it always lags behind the latest release from Sun.

      I was writing an Applet aimed at Internet Cafes as well, I abandoned it when I realised that most cafes would not have a decent JVM installed.

      --
      sheep.horse - does not contain information on sheep or horses.
  72. Actually .NET has the same problem as Java by Jamie+Lokier · · Score: 1

    Sorry to disappoint, but I know .NET developers who've moved between Windows.Forms and Gtk#. There's also WxWindows.

    You could say that Windows.Forms is the only native one, most widely used etc. That's true. It's also not particularly bad, and has many clever features, and good integration with tools, and some parts of it have clearly been thought through.

    But it also has a surprising number of limitations and crapnesses, that mean it's not always the best choice even for a .NET application on Windows.

    Saying Windows.Forms is just like Sun saying to use Swing: it's the official line, but not everyone's doing it, and an informed developer must consider the alternatives if there are people actively using them for some practical (i.e. non-religious) reasons.

    -- Jamie

  73. My Choice: Explained by RagingFuryBlack · · Score: 1

    I generally use AWT or Swing. I use AWT for the main reason that it was what I had originally learned when I started using java and had no idea how inheritance worked. I now find using Swing alot easier and alot more user friendly. Its a much more powerful widget set and why shouldn't I use it? Its the upgrade to AWT. Hopefully they'll phase out AWT in the near future.

    --
    Warning: Corny karma killing post above.
    1. Re:My Choice: Explained by ultranova · · Score: 1

      I now find using Swing alot easier and alot more user friendly. Its a much more powerful widget set and why shouldn't I use it? Its the upgrade to AWT. Hopefully they'll phase out AWT in the near future.

      Impossible, since Swing is built on top of AWT. Top-level Swing containers extend AWT components, Color and Image are both part of AWT, and so on. Removing AWT would break every Java application that uses Swing. Besides, Swing, being pure Java, has to interface with the OS drawing routines somehow, so if AWT was removed, you'd need to add a new low-level toolkit in its place.

      Swing is just lots of libraries built on top of AWT.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  74. Right, or vi versus emacs by VampireByte · · Score: 1

    Since the answer is obvious... the preferred depends on the task at hand. 7337 h4x0r5 use both.

    --

    Run and catch, run and catch, the lamb is caught in the blackberry patch.

  75. Re:As this is a typical Slashdot wankathon story.. by forgotten_my_nick · · Score: 1

    Sorry I missed the bit where it said SWT sucked. All it reads is comparing the two technologies and telling you where one is better then the other in what situation. Unlike the Poster I was replying to which was trying to state that SWT was full out rubbish but not having anything to support that claim.

  76. Stick with Smalltalk by Anonymous Coward · · Score: 0

    Cincom's VisualWorks is so much better than most Java IDEs and GUI libraries, it is like comparing a sportscar to a square wheeled horse drawn wagon.

    A non-commercial version is available at http://smalltalk.cincom.com/downloads/index.ssp?co ntent=smalltalk

  77. AWT is crap, Swing is heavy and slow, SWT is... by master_p · · Score: 2, Informative

    AWT is totally crap; it lacks much functionality of modern GUIs.

    Swing is heavy; it implements its own window system, complete with event queues and region management. For those that don't know what regions are, they are display lists of visible rectangles. Clipping works by subtracting a region from another region, i.e. subtracting one list of rectangles from another list of rectangles. This means two things: a) crazy memory requirements, as each operation produces a new rect, b) slowness in order to compare all rectangles with each other.

    SWT seems the better option, but I have no idea, even after reading the article, if it is totally portable and extensible from Java.

  78. Missing option by hesiod · · Score: 1

    Which one? I don't use any of them: Java is bloated crap.

    1. Re:Missing option by Anonymous Coward · · Score: 0

      Mmm.. I like cheese.
      Bruce Willis is da man.
      Your website is worst shit I've seen in 10 years.

      Isn't it cool to express yourself in tha Interwebb?

    2. Re:Missing option by hesiod · · Score: 1

      > Your website is worst shit I've seen in 10 years.

      Then you haven't looked at too many sites. It's certainly not beautiful, but it doesn't have an animated background, blinking text, or inconsistent layout.

  79. Pretty good if a little misleading by malachid69 · · Score: 1

    Personally, I generally avoid using AWT directly -- but it supports many things that you marked as "N/A". For example:

    Display an image -> java.awt.image.BufferedImage
    Display text and image -> java.awt.image.BufferedImage
    Generic container of other controls with a border and title -> java.awt.Frame
    Add items to the system tray -> java.awt.SystemTray
    etc etc

    Also, while you do comment on the fact that SWT doesn't come with the JDK, you say "If you are developing only for one platform, SWT has an advantage in host compatibility"... that's not quite accurate... IBM has been notoriously behind on JDK implementations (ie: how long until it supports the JDK1.6 features?). The SWT FAQ says that it is built on JDK1.4, so it is already 2 major versions (a few years) out of date. Also, their download page ( http://download.eclipse.org/eclipse/downloads/drop s/R-3.1.2-200601181600/index.php#swt ) doesn't even show my server platform (FreeBSD) on the list...

    Personally, if the library requires a native download, I'm not using it -- too much hassle to maintain.

    --
    http://www.google.com/profiles/malachid
  80. Portable applications for consumer market? by aclidiere · · Score: 1


    Thanks for your comment. You know a lot more about Linux installers than I do.

    "You need to qualify what is an installer."

    I mentioned "desktop application", but I actually meant desktop application for the consumer market. So, by extension, I was referring to installers that verify system requirement, let you choose installation options, install the application on your hard-disk, create icons, etc. I really wish computers were easier to use. I agree that Swing performs pretty well given the constraints it put on itself (non-native widgets, pure-Java rendering). However, there are glitches that programmers must deal with if they are targeting the consumer market. Here are more detailed examples:

    The Java API for fonts under Windows is unfinished. I have Myriad and Myriad Pro installed (very popular fonts, one is TrueType, the other is OpenType), but the Java Environment v5.0 won't see those fonts. Also, some wide-spread PostScript fonts make the JVM crash.

    Say you want your application to launch Acrobat Reader to view a PDF. Is Acrobat installed? The registry will tell you under Windows. You will need some platform-specific code to find if Acrobat Reader is installed.

    Often, it is important that users find a familiar environment when using their applications. I find Swing's color chooser and open/save dialogs too different from their native versions. (In the Swing UI on which I work, the Open/Save dialogs are actually SWT, therefore they look completely familiar to the user.)

    Too often I'm in conflict with other programmers who won't see the importance of small details in the user interface. They will choose a technology assuming that it will have no effect on the user experience.

  81. uhg... by charstar · · Score: 1

    GridBagLayout

    *wretch*

  82. how hard would it be by petermgreen · · Score: 1

    to write a sufficiant wrapper to give a java applet the interface expected for a .net applet and compile it along with the applet using J#?

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    1. Re:how hard would it be by Jamie+Lokier · · Score: 1

      It would be difficult, but not impossible. I would consider it, if .NET applets were ubiquitous.

      But why bother? Most machines cannot run a .NET applet out of the box either - not even most Windows machines running MSIE.

      -- Jamie

    2. Re:how hard would it be by petermgreen · · Score: 1

      because by offering both you maximise the chances your applet can run

      so it would be a good thing if you could offer both .net and java applets whilst sticking to one codebase.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    3. Re:how hard would it be by Jamie+Lokier · · Score: 1

      I see your point, but I think it adds so few users, and is sufficiently complex, and adds to the testing for each applet, that it's not worth the effort.

      If Sun's claim is true, then 50% of browsers can run Java applets with Sun's JVM now. I'd guess (wildly inaccurate I'm sure) that maybe less than 5% can run .NET applets - because IE as shipped is not able to run them out of the box. That was true when I looked into creating .NET applets about 6 months ago. Articles on how to do it included arcane instructions on what you had to do to enable it in IE, and they varied among versions.

      A more interesting effort would be to compile into something that only needs Javascript... that'd add a lot of users. And conveniently, people with older, slower computers could use the JVM (the old browsers have JVMs), while people with faster computers could use Javascript, so the speed might work out ok.

      Conveniently, if it works, that fits in with the AJAX trend.

      -- Jamie

    4. Re:how hard would it be by petermgreen · · Score: 1

      thats true for now certainly but do you really thing ms won't be pushing it out with vista.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  83. Keyboard navigation of web forms by tepples · · Score: 1

    Browser Web form usability just isn't up to the standard established by GUI apps, particularly when it comes to keyboard navigation.

    Have you investigated adding accesskey and tabindex attributes to your site's forms? Or are you talking about your competitors' sites' forms? Or are you talking about some use of forms to which accesskey and tabindex do not apply?