views:

95

answers:

3

I am looking for a Java GUI building tool that generates the Java Swing code for me. I'm planning on using it to get all of the Frame/Panel code created quickly and then customize everything by hand after that.

It would be nice to be able to choose between different layout managers, but it's not necessarily required.

The most important part, the tool can't require any .jar files to be placed in my project (this isn't allowed for the project I'm working on.)

+3  A: 

NetBeans will build pure Swing apps for you, as will a number of other tools.

In fact, as far as I know, that's the rule rather than the exception. Just ask for a Swing app and you'll have pure Java (in most cases).

Carl Smotricz
cool, thanks. I'm trying NetBeans right now.
Robert Greiner
@Steve, ok, I'll try that. You can convert your comment into an answer if you want and I'll upvote it.
Robert Greiner
+2  A: 

I agree with Carl, Netbeans.

By default, when Netbeans creates a Java Desktop Application (swing), it wants to include some other jars. (At least it does for me)

  1. appframework-x.x.x.jar
  2. swing-worker-x.x.jar

Just start from a generic Java Application, then add the GUI classes manually. This will result in a project with no dependencies.

Steve K
+1 thanks for the info
Robert Greiner
If you can get away with this, it's your best bet. Just make sure this meets the spirit of the "no jars" requirement, though. Often this is a corporate/government paranoia about licensing, in which case just lifting the classes and/or source code would still be a no-no.
Benjamin Cox
+1  A: 

Way back when I used JVider to lay out my screens. It's not nearly as complete or complex as NetBeans, but it does allow you to quickly and comfortably lay out screens using GridBagLayout.

What I like about it is that it generates source code and has no runtime requirements. There is a runtime option that will allow you to load your UI from XML files it generates, rather than generating classes, but you don't have to use it.

My process back then was to have JVider generate source classes. Then I would create a subclass and add all the event logic, data binding, etc. to that subclass. This would allow me to tweak the UI files and regenerate without losing any of my logic.

Nowadays I'd typically use NetBeans, but if I had a "no external jars/classes allowed" requirement JVider might be my first choice again.

Good luck!

Benjamin Cox