Is there any IDE that simplifies creating Swing applications (ideally something along the lines of Visual Studio)
Netbeans has some GUI-building support, and it's one of the most popular Java IDEs on the market. Give it a look.
I used to use MyEclipse quite a bit. It had a decent IDE for making Swing forms and such. I assume it has improved in the past year - they seem to add features in gobs and heaps, quite often.
http://www.myeclipseide.com/
I'm a big fan of JetBrains, and when it comes to Java, IntelliJ is the best IDE I have used.
For Swing, they have a fully interactive UI builder. And, for actual coding, their intellisense can't be beat.
Like others have mentioned, Netbeans' visual editor is pretty good, but its based pretty heavily on the Swing Application Framework so you'd need to get an understanding of how it works to properly use it (although you don't need to dig in to just test things).
Other than that there's also:
- the IntelliJ IDEA visual editor (flash demo of the features)
- and Eclipse's Visual Editor
Personally I've used Netbeans' and IDEA's visual editors. Both are nice but I thought Netbeans had a leg up because it doesn't use any proprietary way of saving the GUI structure and instead does something similar to what Visual Studio does - auto-generating the code that you can then add to. IDEA stores the information in a separate file which means you have to use IDEA to edit the layout visually later.
I have not used Eclipse's Visual Editor.
My vote is for Netbeans' visual editor. I think it satisfies what most people are looking for in a visual editor and leaves it flexible enough to plug the holes manually through code without affecting the visual editor (so you can switch back and forth between code and design views without breaking either).
Try Instantiations' Windows Builder Pro. It includes Swing Designer, which is a Swing UI builder. It is based on Eclipse.
For me, the best visual swing editor is JFormDesigner, which you can run standalone or as a plugin for Intellij and Eclipse.
It generates proper (actually readable) source code, it's very ergonomic and intuitive and, above all, very extensible. That last point is really important, because if you want to build a decent swing application, you'll have to extend the base components or use some third-party libraries and it must be easy to integrate those in the visual editor.
It's not free but it's a bargain for the power you get (129 EUR / 159 USD). I've been using it for a few years and love it.
As I'm using eclipse, I use the Visual Editor plugin. It generates clean source code, with good patterns and easy to patch/modify/extend. Unfortunately, it is not very stable. But it's worth trying.
I have switched between several IDEs and the one that I believe has the best GUI builder in terms of use and performance would have to be Netbeans.
I like Eclipse's VisualEditor, sometime ago I've tried to switch to another editor, but found it impossible. Visual editor has this feature that it generates manageable, readable, editable, and easy to understand code. Unlike both mentioned earlier NetBeans editor and WidnowBuilder it uses lazy initialization pattern to separate initialization of components. Also it does not need to lock down parts of code that you cant edit, you may edit code by hand, and VE is still able to work with your changes.
Only disadvantage of VE is that it uses eclipse callisto (there is no official build for ganymede, or europa), so effectively you have to use two eclipses one for VE and one for rest of developement.
I took it from recent discussion on comp.lang.java.gui (I was the autor of this post so I could do it rightfully), here is the link to whole discussion.
Abeille (https://abeille.dev.java.net/) is very good and is based on the JGoodies FormLayout. Unlike almost every other Java GUI builder, Abeille does not generate code by default. In the project I used it on, it was wonderful to avoid reading or scrolling through the layout code (because that code no longer existed). Most of our hand-written code concerned itself with connecting events to actions, simply asking the layout for the relevant controls.
It's a crime that code generation is the default way to layout code in Java because better ways of doing GUIs have been around for decades. I have used Matisse, the NetBeans GUI code generator. While Matisse makes it pleasant to layout components, it is similar to all other code generation tools because when you use Matisse you must live in constant fear that someone else edited the "you cannot edit this in NetBeans" GUI sections outside of NetBeans. As soon as you touch the layout builder again it could destroy their work and then you have a broken GUI. There might be some simple task like re-ordering a variable initialization and its use or re-naming a variable (this was especially a problem when using Matisse's database feature). You know how to do this by editing the un-editable source code but may waste time trying to figure out how to do the same thing in the GUI builder. Like most code generation tools, it might get you started, but eventually you will have to maintain the generated code yourself.
Frankly, I've never seen an editor which comes even close to what I can do manually in a text editor. All the visual editors are nice if you only have very simple needs like putting a few buttons in a window. When things become more complex, visual editors quickly loose their competitive edge.
I usually use a bunch of high-level classes built from more basic widgets and wire my UI from that. This also allows me to easily test my UI with automated JUnit tests (because I can control what the source looks like).
Lastly, changes to the UI won't generate unnecessary noise in the version control system.
We are doing Swing development since nearly 10 years. There are some nice GUI builders available (e.g. JFormDesigner), but all restrict us too much in different kinds.
For example, we have a lot of components without public no-arg constructor (e.g. a JTable subclass which requires the model in the constructor) or we have component factories.
Desktop applications usually have to be obfuscated. Obfuscation very easily breaks user interfaces created with a GUI designer or requires much work to avoid obfuscating such classes.
Another often happening case is that, for example, a panel should only contain some components depending on some condition. Simply hiding them would make the GUI look bad; they rather should not be added instead. I never found a GUI editor which provides this flexibility and even if there would be one, it would be so hard to use, that I definitely would be faster with good old Java code.
I think the best editor that can exist is Visual editor for eclipse. The only drawback is the fact that we can't re-edit the visual part when we modified the source code. I hope one day we will have a tool that rivals Visual Studio on this aspect.