-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Je Mardo 15 Majo 2001 13:29, vi skribis: > I'd like to know the problems with Swing, maybe someone can think up some > good alternatives and we can create The Next Big GUI <:) I don't have time to write a book on the subject, and a lot of complaints can be considered "taste" issues. However, callbacks were always sort of a hack in Swing; Ruby solves this with code blocks. Mostly, I never liked the way one laid out a GUI in Swing. It seems logical and straightforward when you look at small examples, but GUI code gets really ugly really quickly in Swing (or AWT, for that matter). Swing does have a sort of bloated feel to it, too. I don't know why; I suspect that, in actuallity, Swing is really well thought-out and well designed... but I rather dislike the gymnastics I have to go through just to use the JTree widget (in any non-trivial case)... CellRenderers, Models, confusing Listener APIs... it is almost enough to swear me off of GUI programming. MUI used a mechanism whereby you did something like (Ruby pseudo code follows) p = Panel.new( Button.new( "Hey, world!" ), ALIGN_LEFT, MORE_CONSTRAINTS, #... Panel.new( Slider.new( 0, 10, 5 ), SOME_CONSTRAINTS, #... Checkbox.new( "Label" ), CONSTRAINTS, #... ), login_panel, CONSTRAINTS ) I'm not sure this would work in Ruby, because the callbacks would have to fit in there and would mess up the tree; I did, however, like the fact that GUIs were laid out in trees, that the formatting helped you see what contained what, and that the constraints were attached to the widgets without the need for extra code or the creation of extra Constraint objects. This could be easily done in Ruby, although (as I said) I'm not sure it is the best way to do it. It can NOT be done in Java, because Java doesn't support arbitrary runtime parameter counts. MUI had a REALLY intelligent layout engine. I never had the problems with getting GUIs to look right in MUI that I struggle with constantly in Swing. As I remember, there was a basic mechanism for "attaching" edges to other widgets, like in TK, except that the layout engine was dynamic and did some intelligent widget interpretation that somehow resulted in superb default settings, almost every time. The best way to do MUI GUIs was to throw a GUI together with minimal constraints, check out the resulting GUI, and then add a couple of constraints to get what you wanted. I'm very tempted to try to find the original MUI author, and ask him for his help in this. I might be able to sum it up in one example: I could create really sexy GUIs with MUI with a 24 page printout of the MUI header files (C++). I have an entire shelf of JFC books, dealing primarily with Swing, and I *still* have to look for online tutorials sometimes to figure out how to do certain things in Swing. Aside from that, I love Swing :-) > Yes, I wonder if I can find the border between... WM and TK? in Swing. I agree; Swing is a good start, because you a lot more for you buck than with many other GUI toolkits. The downsides including, of course, that the Swing API is huge, that Swing is slow, and that Swing consumes a lot of memory. Converting Swing to C and then adding Ruby hooks might be a better way to go. > LCD issue? What's that? Google mentioned Lowest Common Denominator > programming, is it the issue that AWT can only do what all its supported > platforms do and nothing specific? That should be solved in Swing, I > thought? Yes, lowest common denominator, and it IS solved by Swing. What I like about AWT is that it uses a native API (== native look-and-feel), and is relatively fast and memory efficient, when compared to Swing. === SER Deutsch|Esperanto|Francaise|Linux|Java|Aikido|Dirigibles|GPG === http://www.germane-software.com/~ser jabber.com:ser ICQ:83578737 It occurs to me, however, that there is one fundamental difference between what /they/ want, and what /we/ want. Both government and citizens want pervasive computing; the difference is that citizens want to be able to turn it /off/. -- SER -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.2 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7AZ+gP0KxygnleI8RAiYxAKC65xMXBLf30Z5kogAg/WZMCu9EkACfRk7X hZ4vFl8MPT40t7QGvonJooY= =Zj79 -----END PGP SIGNATURE-----