Join 149,506 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,338 people online right now. Registration is fast and FREE... Join Now!
Much of the user interface work I've done recently has been displayed in a web browser (JSP via Struts). I remember the last time I wrote some Swing interfaces, it took me a while to really master Swing and getting my application to look exactly the way I wanted. Quite frankly, it was a big pain in the a$$. GridbagLayout was the source of a lot of my frustration. I'm sure some of you can relate. Anyway, to cut ot the chase, I thought oif XUL, wondered if Java had something similar, Googled, and came up with loads of hits. The "top" three are in my poll. Since I don't have boatloads of time to try every framework that I come across, I was hoping someone here had tried one or more of them and could give a brief outline of what they liked/disliked. Anyone? Cheers.
This post has been edited by alcdotcom: 10 Jul, 2007 - 10:23 AM
i have never used any of them, i have always preferred making even the most complex GUIs myself, gridbag can be your best friend if you treat it nice, lol.
i have never used any of them, i have always preferred making even the most complex GUIs myself, gridbag can be your best friend if you treat it nice, lol.
I never used visual GUI builders. I enjoyed the challenge, when I was first starting out, of writing custom Swing components with look and feel/behaviors that were not available out of the box. I even had a library of custom containers and widgets. But the more I develop, the more I realize that time is the enemy. Being good is only part of the equation. You also have to be fast. And, if I can find a framework that does not generate superfluous boilerplate code, and helps me to further separate the view from the model/controller code then I want to try it.
GridbagLayout gets a bad rap because it's finicky, but I've had some success with it in the past. The problem is, I haven't used it in...well, a long time and now I've forgotten a lot. I could go back and look at my old code and refresh my memory, but I thought it would be a good time to learn something new and see it performs.
The closest I got to XML UI frameworks was my Open Laszlo experience, that generates Flash or alternatively DHTML code from XML descriptors (and it is a J2EE servlet, just to make a link to this topic) Anyway, it was OK, but I know you are looking for something else. On the Gridbag side of things: I've used it a lot, because it seemed to be the fit all, everything is possible solution. However as I've faced the problem of time, I've realized that it is overkill in 80% of the cases, and almost all layouts can be decomposed to a couple of panels with simple layouts (flow, box, spring...) that can be programmed and TESTED in a fraction of time, and they make upgrading and modifying also much easier. I've only touched the surface of IDE generated GUI building with NetBeans, and although it looked to be correct, I've just had to give up on it, because the project needed dynamic GUI generation, so static forms were just not enugh for it...
I've only touched the surface of IDE generated GUI building with NetBeans, and although it looked to be correct, I've just had to give up on it, because the project needed dynamic GUI generation, so static forms were just not enugh for it...
Very true. I imagine GUI builders like that are good for quick prototypes. I played with Netbeans GUI builder briefly, but when I found out Netbeans doesn't support the CVS sserver protocol I uninstalled it...with extreme prejudice.
I use Eclipse, without drag and drop, so i had to be good with the LayoutManagers. You are right that one doesn't just have to be good, but has to also be fast! I have been a strong friend of drag and drop, mostly because of the .NET background, but now being a friend of the GridBagLayout, i haven't looked back. I would recommend Swing developers get more acquainted to this LayoutManager, i9t's just a piece of cake, imho.
This all makes for good conversation, but I've still yet to hear from anyone regarding the topic. I don't need advice on Layout managers. When I was doing GUI programming I got very acquainted with them. But, since moving away from GUI programming and having matured more as a developer, I see the importance of separation of concerns (e.g. getting event handling code out of GUI code) and maintainability - something Swing and Layout Managers don't really promote. I could do it myself, but why reinvent the wheel.
Anyway...when I get time, I'll probably just try these frameworks myself to determine which one is best. When (if) that happens I'll post a brief comparison.
I thought it is entirely possible to separate the GUI from the data! As in having a tablemodel and a JTable in different classes and a TablemodelListener as well? Infact, thats what i do. Anyway, i agree with you that Swing does not promote the separation of concerns, but it handles them well when nicely put across by a neat, disciplined and diligent programmer. For those doubting the abilities of GUI/swing just have a look at William's screenshots, or this one i have posted:
I thought it is entirely possible to separate the GUI from the data! As in having a tablemodel and a JTable in different classes and a TablemodelListener as well? Infact, thats what i do. Anyway, i agree with you that Swing does not promote the separation of concerns, but it handles them well when nicely put across by a neat, disciplined and diligent programmer. For those doubting the abilities of GUI/swing just have a look at William's screenshots, or this one i have posted:
Never said it wasn't possible. I merely said that Swing's design doesn't lend itself to the goal of separation of concerns. I'm mainly talking about controller code here. Let me liken it to writing a JSP application. It's entirely possible to write good, MVC code using JSPs. But "discipline" means exactly squat when you're under the gun and your manager hands you a project and says, "we need it yesterday." Do you take the time to design the project and write it entirely using Servlets and JSPs, taking care not to accidentally let a scriptlet get into your code? Sure...if you want to work someplace else. Otherwise you use Struts, JSF, or other frameworks that make your work quick, scalable, and easily maintainable by others. Take this example and apply it to a GUI application. Do I ride the Swing "bicycle" to get from point A to point B? Or do I ride the framework "express rail?"
I'd say I'm very aware of Swings capabilities. As a case in point, here are some screen captures of an RSS reader I wrote several years ago when I was just getting into Swing.
Edit: The bottom right pane is an integrated browser (IE or Firefox). Also, I implemented drag and drop for my folders and feeds on the left, but I couldn't get a screen capture of it.
This post has been edited by alcdotcom: 11 Jul, 2007 - 08:37 AM
Strange, I am certain it does Maybe it was a long time ago...
Netbeans had sserver support in version 3, but then broke it in later versions. Not sure why. Sucks though because I was looking forward to trying the visual Web builder (for fun) and the C/C++ plug-in. But I keep much of my code on a public CVS server that uses sserver only, so I'd never do any serious development with Netbeans. I could create a sandbox on the CVS machine at work and VPN tunnel in from my work machine, but that's too much of a pain in the a$$ when I could just use Eclipse.
This post has been edited by alcdotcom: 11 Jul, 2007 - 08:49 AM
In 5.5 CVS is working fine, I'm not sure since when. It's true, that in the 4.x versions there were some strange things, or let's call it a major restructure with tons of feature loss, but fortunately at that time I didn't need those things. Right now I use Eclipse too, but I have major concerns regarding it's CVS capabilities - it is completely useless and error prone if used together with another CVS software, and can become unstable, too(I know it's not a common situation, but I had to go that way, and it made me some long days)
However if it works fine for you, then it means it is maybe my bad, or your good luck, and stick with it OK, it's getting too far again, so anybody using any XML based Java GUI frameworks?