Release JNib?
I’ve had two requests from people at prominent companies in the past few weeks for copies of JNib, which I wrote as a MacHack hack in 2002. JNib is a set of Java classes that translate Carbon nib files into a Swing UI at runtime, much as IBCarbonRuntime translates the same nibs into a Carbon UI. In other words, it accomplishes a couple potentially useful things:
- You can create a UI for a Java application in Interface Builder.
- You can use nib files on Windows.
- Java applications that use it may come closer to following the Aqua HI guidelines for control spacing than Java applications built without it.
I’m wondering if I should release the code on SourceForge or something like that. The catch is that I really don’t have time to support it, add features, or fix bugs. But given its potential usefulness, perhaps somebody else would be willing to own the project.
Any thoughts, comments, or suggestions?
Buzz Andersen Said,
October 27, 2003 @ 1:36 am
I had no idea you had implemented anything like that! I had thought about trying to accomplish something similar after spending torturous hours implementing a Swing UI in my previous job. In fact, I’d always wondered why Sun had never hit on the idea of using a nib-type file to make UI construction easier–they already have the facility in Java for object serialization. And the introspection API would make the dynamic “target/action” paradigm (a la Cocoa) possible. Unless I’m missing something…
Anyway, I say why not? It’s a cool idea!
Eric Said,
October 27, 2003 @ 1:41 am
What you’re missing for JNib specifically is that it doesn’t take advantage of anything in IB other than control creation and layout. Since it’s based on Carbon nibs (Cocoa nibs aren’t really parseable), there’s no connection between the nib and the code. So it can’t automatically initialize member variables, create subclasses, or set up actions. All of that would require help from IB itself.
Of course, this is just what I wrote in two days of serious hacking. It’s possible that someone with a bit more time could accomplish a lot more….
Buzz Andersen Said,
October 27, 2003 @ 2:13 am
Right–I guess I was really talking about two different things above. I think your idea of using IB to lay out native Java UIs is pretty cool, but then I was also sort of musing that it would theoretically be possible to create a completely Java native take on the Cocoa nib concept.
That is, you would have files containing serialized objects which would be unarchived by some sort of application bootstrap mechanism. The serialized objects would store their targets and actions in the form of java Method objects. I guess that brings up one major problem–it would probably require a new event model :-).
Anyway, I only mention it because I always wondered if something like that would be possible in Java.
Daniel Steinberg Said,
October 28, 2003 @ 5:58 am
Eric -
We’d love to host this at http://www.java.net . I was speaking to Bob Fraser yesterday about getting more Mac/Java projects on the site.
Best,
D
Avi Said,
October 28, 2003 @ 8:11 am
I’d love to see a real release of this.
What would be very nice is to have a real layout manager. That way, you could handle resizing layouts well. Now that Panther has resizing constraints in IB, that’s all you need.
Licensing is another issue. BSD would allow it to be used commercially (which I hope you wouldn’t mind).
Avi
Greg Casamento Said,
October 30, 2003 @ 6:05 am
Releasing it might also help other Free Software projects, such as GNUstep, read nib files created by MOSX. I maintain the IB equivalent for GNUstep called Gorm and being able to import nib files would be a real plus.
GJC